Skip to content

dept.GetMembers

Overview

This method is used to get user information belonging to a department in a "Server Script".

Syntax

dept.GetMembers()

Return Value

Return a list of "user objects".

Columns you cannot view

From version 1.5.10.0, the values of columns that the user running the server script cannot view are null (the properties themselves remain). By default, only tenant managers can view TenantManager and Disabled. Extended columns that the user cannot view are not included in ClassHash and the other hashes.

You can change which columns can be viewed in Column.json. For details, see "Extended Column".

Usage Examples

The following example outputs to the log the usernames of members of the department to which the logged-in user belongs.

JavaScript
let myDept = depts.Get(context.DeptId);
if (myDept) {
    const members = myDept.GetMembers();
    for (let member of members) {
        context.Log(`Name: ${member.Name}`);
    }
}

Supported Versions

Supported versions Body
1.5.10.0 and later Changed the values of columns that the user cannot view to null