SetUserFilter
A SetUserFilter() function sets a filter for a chosen user-type field.
Warning: If this function is used in an automatic rule you should reset the filter if ForwardCase() function is also used.
Syntax
SetUserFilter(FieldTitle, FilterType, FilterValues, [SubDepartments]);
Function arguments
- FieldTitle – (String) a user-type field title/name;
- FilterType – (String) could be „department”, „group”, „users” or „allusers”;
- FilterValues – (String) department or group names or ids, or user logins, ids or e-mails, separated by „,” or „;”;
- SubDepartments – (Boolean) set sub departments. Used only when filterType is „department”.
Return value
This function returns Boolean.
This function return true.
Examples
Example 1
This will allow to select users only from 2 groups: Administrators and Programmers in field „Employees”.
SetUserFilter("Employees", "Group", "Administrators, Programmers");
Example 2
This will allow to select users from 2 departments: Administrators (id 1) and Programmers (id 2) and their sub departments in field „Employees”.
SetUserFilter("Employees", "Department", "1, 2", true);
Example 3
This will allow to select users only from the given user list in field „Employees”.
SetUserFilter("Employees", "Users", "login1, login2@amodit.pl");
Example 4
This will allow to select any user in „Employees” field.
SetUserFilter("Employees", "AllUsers");