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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Find all User Groups for a Given User

joetenny
4-Participant

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.

1 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
4-Participant
(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

Top Tags