cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Find all User Groups for a Given User

joetenny
5-Regular Member

Find all User Groups for a Given User

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.

ACCEPTED SOLUTION

Accepted Solutions

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();

View solution in original post

4 REPLIES 4

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();

jensc
17-Peridot
(To:ashaban)

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

joetenny
5-Regular Member
(To:ashaban)

Thanks.  I am pretty novice at developing inside of ThingWorx.  I started creating a Thing; what Base Thing Template should I use?

You can use a GenericThing thing template.

 

Regards,

Sachin

Announcements


Top Tags