0

I am creating a screen flow and want to set Condition visibility a picklist field based on the user belonging to a particular public group but I can't see option for group.

3
  • 1
    This might be little complex as we cannot use groupmember directly. Create a varible of type boolean and query groupmember object with memberid=user.id and get all records and in for loop add a decision and make that variable to True and you can use that variable for visibility Nov 28, 2022 at 13:15
  • @SaiPraveenKakkirala - are you sure this works if the Public Group member is a Role or Role w/ Subordinates? see schema
    – cropredy
    Nov 28, 2022 at 18:51
  • @cropredy, Yeah I forgot to mention that point. Yeah it does not work Role or Role w/ Subordinates. It only works if user is added as GroupMember Nov 29, 2022 at 1:09

1 Answer 1

1

This is not directly doable in Flow. A public group can have as members

  • direct users
  • public groups that have direct users
  • Roles that have direct users
  • Roles and Subordinates which recursively have direct users

See schema

You will need an element prior to the display of the screen:

  • Call an invocable Apex that takes as arguments the userId and groupApiName and returns a boolean (true - in group, false, not in group). This result variable can be used in the filter on the screen flow
  • The invocable Apex will need to use the logic shown in this Help article.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .