Obtain employee information within the department
Command Description
Obtain the information of employees in the department based on the department ID and return it in the form of an array
Command Prototype
UserInfoArray = WxWork.GetUserList(wxwork_obj, department_id, recursive, simple_info)
Command parameter
parameter | mandatory | type | default value | Instructions |
---|---|---|---|---|
wxwork_obj | True | expression | WxWorkObject | Enterprise WeChat object created using the WxWork. Create command |
department_id | True | string | "" | The specified department ID. If specified as empty or an empty string, retrieve employee information for the entire enterprise |
recursive | True | boolean | True | Specify whether to include all subordinate departments. If not, only obtain the information of direct employees in the current department; If yes, employee information from subordinate departments will also be obtained |
simple_info | True | boolean | True | Do we only need to obtain basic information. If yes, only basic information such as employee name and ID will be included; If not, it will also include the employee's phone number, email, and other information, but it requires a relatively high level of permission |
Return result
Return_array, Assign the result of running the command to this variable.
Run instance
/********************************* Get Employee Information in Department *********************************
Command Prototype:
UserInfoArray = WxWork.GetUserList(wxwork_obj, department_id, recursive, simple_info)
Input Parameters:
wxwork_obj -- WeChat Work object. Note: WeChat Work object created using the WxWork.Create command.
department_id -- Department ID. Note: Specified department ID. If specified as empty or empty string, retrieves employee information for the entire enterprise.
recursive -- Include all subordinate departments (including sub-subordinate departments). Note: Specifies whether to include all subordinate departments. If no, only retrieves direct employee information of the current department; if yes, also retrieves employee information from subordinate departments.
simple_info -- Retrieve only basic information. Note: Whether to retrieve only basic information. If yes, only includes basic information such as employee name and ID; if no, also includes employee phone numbers, email addresses, etc., but requires higher permissions.
Output Parameters:
return_array -- Variable to store the output of the function call.
Important Notes:
None
********************************************************************************/
Dim return_array = ""
UserInfoArray = WxWork.GetUserList(WxWorkObject, "", True, True)
TracePrint(return_array)