Free cookie consent management tool by TermsFeed a!groupsForUser() Function
a!groupsForUser() Function

Function

a!groupsForUser( username, isGroupAdministrator, groupTypes )

Returns the groups where the user is a member or has Administrator permissions.

Parameters

Keyword Type Description

username

User

The user whose group membership information should be retrieved.

isGroupAdministrator

Boolean

Determines whether to return groups where the user is an administrator, rather than a member. When set to true, returns the groups where the user has Administrator permissions. When set to false, returns the groups where the user is a member. Default: false.

groupTypes

List of Group Type

Limits the returned groups to those of the specified type(s). If this property specifies multiple groups types, the function returns groups that match any of the specified group types.

Returns

List of Group

Usage considerations

By default, the function returns the groups where the specified user is a member. Only one user can be specified in the function.

Users with Administrator permissions for a group are not always members of the group.

Invalid users will result in an error.

Examples

Get groups where the user is a member

Given a User, "jane.doe", is a member of Groups: {[Group:7],[Group:8]}.

1
2
3
a!groupsForUser(
  username: "jane.doe"
)

returns

1
2
3
List of Group
  7 - Group A (Group)
  8 - Group B (Group)

The list includes returned groups where the User is a member.

As long as the User is a member of the group, the list will include that user, even if the following are true:

  • The User has Administrator permissions for the group.
  • The isGroupAdministrator property for the function is set to 'false'.

Get groups where the user is an administrator

Given a User, "jane.doe", is a member of Groups: {[Group:7],[Group:8],[Group:9],[Group:10],[Group:11]} and has Administrator permissions for Groups: {[Group:9],[Group:10]}.

1
2
3
4
a!groupsForUser(
  username: "jane.doe",
  isGroupAdministrator: fn!true()
)

returns

1
2
3
List of Group
  9 - Group C (Group)
  10 - Group D (Group)

Though the User is a member of many groups, they are only assigned Administrator permissions for two groups.

Limit the groups by group type

Given a rule input ri!groupType of type Group Type with the following groups of this type: {[Group:7],[Group:8],[Group:9],[Group:10],[Group:11]} and a User Jane Doe is a member of groups: {[Group: 7], [Group: 8]} and an administrator of [Group: 9].

1
2
3
4
a!groupsForUser(
  username: "jane.doe",
  groupTypes: ri!groupType
)

returns

1
2
3
List of Group
  7 - Group A (Group)
  8 - Group B (Group)

In this example, the returned list excludes Group 9, even though Group 9 has the correct Group Type. The list excludes Group 9 because the User has Administrator permissions for that group but is not a member.

Invalid user

Given User "john.doe" does not exist in the system.

1
2
3
a!groupsForUser(
  username: "john.doe"
)

returns

1
Expression evaluation error at function a!groupsForUser: The username Invalid user: john.doe is not a valid user.

Feature compatibility

The table below lists this function's compatibility with various features in Appian.
Feature Compatibility Note
Portals Partially compatible

Can be used with Appian Portals if it is connected using an integration and web API.

Offline Mobile Compatible
Custom Record Field Expressions Incompatible
Process Reports Incompatible

You cannot use this function to configure a process report.

Process Events Incompatible

You cannot use this function to configure a process event node, such as a start event or timer event.

Open in Github Built: Fri, Apr 19, 2024 (06:08:06 PM)

a!groupsForUser() Function

FEEDBACK