How to Identify System Groups with SYSTEM_GROUP_ UUIDs in Appian

In my Appian environment, I’ve noticed that some groups have UUIDs that start with SYSTEM_GROUP_ followed by the group name, instead of the usual alphanumeric UUID format.
How can I logically identify or classify these groups separately from regular groups? 

When I use scimGetGroup() on these SYSTEM_GROUP_ groups, it doesn’t return any group attributes, unlike the other groups with standard UUIDs.
Is this expected behavior? And is there a workaround to retrieve attributes for these system groups?

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    It is possible to retrieve the UUID via the getgroupuuid in the People Functions. A very simple solution is to do a forEach in combination with a like to identify anything that starts with SYSTEM_GROUP_.

    I also wrote an in depth blog post on a better way to query groups which might be helpful: https://blog.appiandevs.io/005-a-better-way-to-work-with-groups-in-appian-part-3/

    Using this method I can easily query for this:

  • 0
    Certified Lead Developer
    How can I logically identify or classify these groups separately from regular groups? 

    I have added logic to the code. Have a look at it.

    Is this expected behavior?

    Yes

    And is there a workaround to retrieve attributes for these system groups?

    I have added logic to the code. Have a look at it.

    a!localVariables(
      local!allGroups: a!groupsForUser(username: loggedInUser()),
      local!groupData: a!forEach(
        items: local!allGroups,
        expression: a!map(
          group: fv!item,
          uuid: getgroupuuid(fv!item),
          isSystemGroup: a!startsWith(getgroupuuid(fv!item), "SYSTEM_GROUP_")
        )
      ),
      a!map(
        allGroups: local!allGroups,
        systemGroups: index(
          local!groupData.group,
          wherecontains(true, local!groupData.isSystemGroup),
          {}
        ),
        regularGroups: index(
          local!groupData.group,
          wherecontains(false, local!groupData.isSystemGroup),
          {}
        ),
        systemGroupUUIDs: index(
          local!groupData.uuid,
          wherecontains(true, local!groupData.isSystemGroup),
          {}
        ),
        regularGroupUUIDs: index(
          local!groupData.uuid,
          wherecontains(false, local!groupData.isSystemGroup),
          {}
        ),
        groupAttribute: a!forEach(
          items: local!allGroups,
          expression: group(groupId: fv!item, property: "groupName")
        )
      )
    )

  • 0
    Certified Lead Developer

    I would not directly use system groups in your scenario. Did you consider to create a child groups and use these instead?

  • 0
    Certified Lead Developer

    Ideally those system groups should not be directly used in any application. Yet to answer your question, please see the below code

    a!localVariables(
      local!allGroups: a!groupsForUser(username: loggedInUser()),
      /*To find and classify system groups from regular groups - This returns 1 for system groups and 0 for regular ones*/
      local!systemGroupIndexes: a!foreach(
        local!allGroups,
        find("SYSTEM_GROUP", getgroupuuid(fv!item))
      ),
      /* To retrieve group attributes no special code or changes are needed just pass the group object*/
      a!foreach(
        local!allGroups,
        group(fv!item, "groupName"),
        
      )
       /*To get all the system groups in one variable*/
      /*index(local!allGroups,wherecontains(1,local!systemGroupIndexes),{})*/
    )