FunctionCopy link to clipboard
a!groupsForUser( username, isGroupAdministrator, groupTypes )
Returns the groups where the user is a member or has Administrator permissions.
ParametersCopy link to clipboard
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. |
ReturnsCopy link to clipboard
List of Group
Usage considerationsCopy link to clipboard
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.
ExamplesCopy link to clipboard
Get groups where the user is a memberCopy link to clipboard
Given a User, jane.doe
, is a member of Groups: {[Group:7],[Group:8]}
.
1
2
3
a!groupsForUser(
username: "jane.doe"
)
Copy
Returns
1
2
3
List of Group
7 - Group A (Group)
8 - Group B (Group)
Copy
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 for the logged in userCopy link to clipboard
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
)
)
Copy
Returns
1
2
3
List of Group
7 - Group A (Group)
8 - Group B (Group)
Copy
Get groups where the user is an administratorCopy link to clipboard
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()
)
Copy
Returns
1
2
3
List of Group
9 - Group C (Group)
10 - Group D (Group)
Copy
Though the User is a member of many groups, they are only assigned Administrator permissions for two groups.
Limit the groups by group typeCopy link to clipboard
Given the following:
- A rule input
ri!groupType
of typeGroup Type
with a value ofTeam
. - The following groups' type is
Team
:{[Group:7],[Group:8],[Group:9],[Group:10],[Group:11]}
. - A user named 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
)
Copy
Returns
1
2
3
List of Group
7 - Group A (Group)
8 - Group B (Group)
Copy
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 userCopy link to clipboard
Given User "john.doe" does not exist in the system.
1
2
3
a!groupsForUser(
username: "john.doe"
)
Copy
Returns
1
Expression evaluation error at function a!groupsForUser: The username Invalid user: john.doe is not a valid user.
Copy
Feature compatibilityCopy link to clipboard
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 | |
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. |