Skip to main content
New Participant
Jan 29, 2024 4:29 AM UTC
Question

Group membership rule to exclude certain users

Hey Techies,

I have a Group 'User Group 1' with membership to include all the members of 'Subgroup 1'. 

For testing purposes, I want to exclude selective members of 'Subgroup 1' from 'User Group 1' while maintaining the subgroup membership rule.

Any pointers?

4 replies

mathieud0001
Genius
Jan 29, 2024 5:06 AM UTC

This can obviously be refactored to be more efficient, robust but it would look like something along these lines:

a!localVariables(
  local!groupMembers: a!groupMembers(group: ri!group, memberType: "USER").data,
  remove(
    local!groupMembers,
    wherecontains(
      cast(
        typeof(loggedInUser()),
        local!groupMembers
      ),
      ri!membersToExclude
    )
  )
)

harshitb6843
Brainy
Jan 29, 2024 7:03 AM UTC

I don't see a way to configure the membership rule to include all the members of a group unless you add that group as a member. 
So I don't think you will be able to do that via membership rules. You can try using this "Does not equal" operator and see if this works for you. 

mathieud0001
Genius
Jan 29, 2024 12:39 PM UTC

In my experience, group rule memberships can be hard to troubleshoot.

stefanhelzle0001
Brainy
Jan 29, 2024 7:39 AM UTC

The mathematical set functions might be an option. Did you try difference()?

https://docs.appian.com/suite/help/23.4/fnc_set_difference.html