a!groupsForUser( username, isGroupAdministrator, groupTypes )
Returns the groups where the user is a member or has Administrator permissions.
Keyword | Type | Description |
---|---|---|
|
User |
The user whose group membership information should be retrieved. |
|
Boolean |
Determines whether to return groups where the user is an administrator, rather than a member. When set to |
|
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. |
List of Group
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.
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:
isGroupAdministrator
property for the function is set to 'false'.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.
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.
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 | Note |
---|---|---|
Portals | Partially compatible | Can be used with Appian Portals if it is connected using an integration and web API. |
Offline Mobile | Compatible | |
Sync-Time Custom Record Fields | Incompatible | |
Real-Time Custom Record Fields | 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. |
a!groupsForUser() Function