Flow Designer - If Condition (Group)

Lloyd700
Tera Contributor

This is my first post, so hopefully this is the right area!

 

I have created a group under "System Security" -> "Users & Groups" -> "Groups", and I have added a user into the group.  I am working on a flow within Flow Designer.  I'm trying to add an "If" condition based on the group that was created.  However, I can't find a way to specify the group.

 

In an "Ask For Approval" action, I'm able to add the group there via the, "Add Group" button.

 

I feel like I'm making this way harder than it needs to be, but I can't figure out how to do an "If" logic based on a group.  Can someone help me out?

1 ACCEPTED SOLUTION

Clara Lemos
Mega Sage
Mega Sage

Hi @Lloyd700 ,

 

Are you trying to verify if the requestor is a member of the group?

If yes, then you need to use a 'Look Up Record' in the 'sys_user_grmember' table with the condition that the User is the requestor and the group is your group. After that add a if condition to verify if the look up was successful , if it was the user is a member of the group , and if not he isn't.

 

In this post you can see an example on how it was done : Solved: Look up records and use it to check whether a user... - ServiceNow Community

 

If that helps please mark my answer as correct / helpful!
And if further help is needed please let me know

Cheers

View solution in original post

8 REPLIES 8

Clara Lemos
Mega Sage
Mega Sage

Hi @Lloyd700 ,

I think the easiest way of doing is if you try the above to check if the user is a member of the group and if he is not then you "ask for approval" , if he is a member you can just follow your flow. 

 

Let me know if that works for you 🙂 

Hey @Clara Lemos 

 

That worked like a charm.  For anyone that follows the link Clara provided above, there is a checkbox that is, "Don't fail on error".  Make sure to check that, because if the look up fails and it's not checked, it will just pause there.

Clara Lemos
Mega Sage
Mega Sage

Hi @Lloyd700 ,

 

That's good to hear !! Could you mark my answer as correct/helpful to help others find the answer?

 

Thank you!

Lloyd700
Tera Contributor

Well, I thought I had it, but I don't think I'm referencing the group properly.  Regardless of who submits the form, it is failing the group lookup.  The user lookup is:  Trigger - Service Catalog➛Requested Item Record➛Opened by➛Name.  Obviously, the group lookup is just looking up a group I manually created.

 

Can someone help me with what I've done wrong in that lookup process?