Skip to main content
12-Amethyst
December 6, 2022
Solved

Find all User Groups for a Given User

  • December 6, 2022
  • 1 reply
  • 2766 views

I am trying to figure out an easy way to find all User Groups for a Given User.  I know how to find User Groups for the logged in User, just not for other Users.  Someone had mentioned using a GetGroups service for a specific user but I don't know where that is located in Composer.  Any help here will be appreciated.

Best answer by ashaban

You can do that with a service in composer:

 

Create a thing and a new service with EntityList info table as a result;

Input the user name as a string

 

This is the most important line: 

 

// result: INFOTABLE dataShape: "EntityList"
let result = Users["someUser"].GetGroups();

1 reply

ashaban12-AmethystAnswer
12-Amethyst
December 6, 2022

You can do that with a service in composer:

 

Create a thing and a new service with EntityList info table as a result;

Input the user name as a string

 

This is the most important line: 

 

// result: INFOTABLE dataShape: "EntityList"
let result = Users["someUser"].GetGroups();

17-Peridot
December 6, 2022

Just a clarification, the "GetGroups" service returns inherited groups as well, not only the groups that the user is actually a member of.