users.Get
Overview¶
Get the information of one user by specifying the user ID in Server Script. To get multiple users at once, use users.GetList.
Methods¶
Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| userId | long | Yes | Specify the user ID to get. |
Usage Examples¶
const user = users.Get(11);
if (user) {
context.Log(user.LoginId + ', ' + user.Name);
} else {
context.Log('The user does not exist.');
}
Return Value¶
Returns the "user object". For the layout of the object, see "Developer's Guide: Server Script: user". If no user exists with the specified ID, null is returned.
{
"TenantId": 1,
"UserId": 11,
"DeptId": 3,
"LoginId": "yamada",
"Name": "Taro Yamada",
"UserCode": "U0011",
"TenantManager": false,
"Disabled": false,
"ClassHash": {
"ClassA": "test-class-column"
},
"NumHash": {
"NumA": 100
},
"DateHash": {
"DateA": "2026-08-19"
},
"DescriptionHash": {
"DescriptionA": "Supplementary description"
},
"CheckHash": {
"CheckA": true
}
}
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".
Cautions¶
This is a method used in "Server Script". It cannot be used in "Script".
Supported Versions¶
| Supported versions | Body |
|---|---|
| 1.5.10.0 and later | Changed the values of columns that the user cannot view to null |