Hello everyone,
I am trying to add a filter for a custom profile field in the configurable report. I have tried adding a filter for username using the User field filter and used this %%FILTER_USERS:user2.username%% in my SQL query and it's working fine.
I have a custom profile field for businessunit. Can someone please tell me how to implement a filter for custom profile fields? Which filter should I use in the SQL query?
This is the query that I am using:
(SELECT d1.data FROM prefix_user_info_data d1
JOIN prefix_user_info_field f1 ON d1.fieldid = f1.id AND f1.shortname = 'businessunit'
WHERE d1.userid = user2.id
) AS 'businessunit',
(SELECT d1.data FROM prefix_user_info_data d1
JOIN prefix_user_info_field f1 ON d1.fieldid = f1.id AND f1.shortname = 'location'
WHERE d1.userid = user2.id
) AS 'location',
Moodle version: 3.10
Thanks in Advance.