Servicely Administration
Scripting
User Object (Client and Server)
3 min
to assist in getting quick access to various details of a user record, we have two different versions of the user object one for server side, one for client side server to access the server side version of the user object, you can access it by doing the following //all lower case user; //this can then be used such as let userid = user getid(); method returns description getid() string this gets the id of the currently logged in user record as a string getusername() string this gets the user name of the currently logged in user record as a string getfirstname() string this gets the first name of the currently logged in user record as a string getlastname() string this gets the last name of the currently logged in user record as a string getemail() string this gets the primary email of the currently logged in user record as a string gettimezone() string this gets the timezone of the currently logged in user record as a string getcompanyid() string this gets the company id of the currently logged in user record as a string getrecord() table object this gets the whole table record version of the currently logged in user record as a table object getroles() array of strings this gets the role names of the currently logged in user record as an array of strings hasrole(rolename string) boolean this determines if the currently logged in user has a specific role and returns a boolean getgroupids() array of strings this gets the group ids of the currently logged in user record as an array of strings client to access the client side version of the user object, you can access it by doing the following //upper case first letter user; //this can then be used such as let userid = user getid(); method returns description getid() string this gets the id of the currently logged in user record as a string getusername() string this gets the user name of the currently logged in user record as a string getfirstname() string this gets the first name of the currently logged in user record as a string getlastname() string this gets the last name of the currently logged in user record as a string getemail() string this gets the primary email of the currently logged in user record as a string gettimezone() string this gets the timezone of the currently logged in user record as a string getroles() string this gets the role names of the currently logged in user record as an array of strings hasrole(rolename string) boolean this determines if the currently logged in user has a specific role and returns a boolean