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 that you are a member of Groups: {[Group:7],[Group:8]}
.
1
2
3
4
5
6
a!localVariables(
local!users: loggedInUser(),
a!groupsForUser(
username: local!users
)
)
Returns
1
2
3
List of Group
7 - Group A (Group)
8 - Group B (Group)
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 the following:
ri!groupType
of type Group Type
with a value of Team
.Team
: {[Group:7],[Group:8],[Group:9],[Group:10],[Group:11]}
.{[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 | Custom record fields that evaluate in real time must be configured using one or more Custom Field functions. |
Process Reports | Incompatible | Cannot be used to configure a process report. |
Process Events | Incompatible | Cannot be used to configure a process event node, such as a start event or timer event. |
a!groupsForUser() Function