Skip to main content
January 29, 2024
Question

Group membership rule to exclude certain users

  • January 29, 2024
  • 4 replies
  • 0 views

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
Brainy
January 29, 2024

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
January 29, 2024

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
Brainy
January 29, 2024

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

stefanhelzle0001
Brainy
January 29, 2024

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

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