Important Update: Some Community URL Redirects are Under Maintenance. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Check if user belongs to a certain group

PoojaVG
Contributor II

Hi everyone,

 

I have a record permission field which defaults to record creator, but it can also be changed to anyone else as it has ALL USERS list available for selection.

 

Once a user is selected to this Record permission [Finding Issuer], I would like to check if this user belongs to Group A or not.

 

I have used the following in a calculated text field

IF(CONTAINS(ANY, GETGROUPS([Finding Issuer]), GROUP(NAME, "ICFR", "IA")), "Yes”, “No”)

but this outputs "No" as the GETGROUPS([Finding Issuer]) does not return any value. 

 

Is it because that the record permission does not have any group assigned to it and rather has ALL USERS?

 

Any suggestions for this?

 

Is using a REST API in a custom object better that a calculated text with above approch better?

 

If REST API is my go to for this scenarion.. 

how to use "/api/core/system/group/user/222" to compare the output to existing groups?

3 REPLIES 3

Richard
Contributor III

It's been several years and still has no answers... ... so disappointing because I have the same requirement now. 

But @PoojaVG , if you have already had the solution, I'd really appreciate it if you could share it.

 

JenAnderson
Contributor II

@PoojaVG/@Richard,  

I recently solved for this with a manual record permission field called [Record Creator's Group(s)] with Field Population set to "Default to the record creator's groups" and the user/groups list containing the specific group(s) I wanted to know if the creator is a member of.  I than used a calculated text field with the below formula as a quick Yes/No indicator.  To prevent the formula from breaking if the name is ever changed I used the group ID versus Name but either will work. 

IF(CONTAINS(ANY,GETGROUPS([Record Creator's Group(s)]),GROUP(id,1309)),"Yes","No")

One thing to keep in mind is that this solution will give any group identified in the [Record Creator's Group(s)] permission field read access to the record which may not be appropriate for all situations.

 

@JenAnderson 

Thank you so much for sharing! Your solution solved my problem. We happen to need the permission to be granted to the related group in that way...but really hope Archer could provide a function to get this done in an easier way.