SetUserFilter

This function set filter for user field.

Syntax

SetUserFilter("FieldTitle", "FilterType", "FilterValues", ["SubDepartments"]);

Function arguments

  • FieldTitle – (String) The user field title
  • FilterType – (String) Could be „department” or „group”.
  • FilterValues – (String) Department or group ids separated by „,” or „;”.
  • SubDepartments – (Boolean) Set sub departments. Used only when filterType as „department”.

Return value

This function returns Boolean.
This function return true.

Examples

Example 1:
This will set users for user field „Employees” only from 2 groups: Administrators and Programmers.

SetUserFilter("Employees", "Group", "Administrators, Programmers");

Example 2:
This will set users for user field „Employees” from 2 departmets: Administrators and Programmers and sub departments.

SetUserFilter("Employees", "Department", "1, 2", true);
Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.