Filter joined

Hi everyone,

i’m trying to add a filter join in my custom data but I can’t.
Here is my sql request :

users.registration_number AS `Num agent`, `Direction`,

FROM glpi_plugin_fields_uservpns AS uservpns

LEFT JOIN glpi_users AS users ON
LEFT JOIN glpi_profiles_users AS profiles_users ON (uservpns.items_id=profiles_users.users_id AND profiles_users.entities_id NOT IN (1,39) AND profiles_users.is_dynamic=1)
LEFT JOIN glpi_entities AS entities ON (profiles_users.entities_id =

WHERE uservpns.compteactiffield=1
AND IN {{direction}}

Here is the error :
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'glpi_entities.nameIN ('IT')' at line 13

In my Where clause, I’ve tried

WHERE uservpns.compteactiffield=1
AND {{direction}}

But I get this error :
Unknown column '' in 'where clause'

Could you help me please ?

Hi @Livier
You cannot use table aliases when using Field Filters:

Thank you very much for your help