Get the group to which the user selected in the fields belongs.
When this action is executed, the information of the group to which the user selected in the user selection field belongs will be saved as the result of the action. If the user belongs to multiple groups, all of them will be retrieved.
If multiple users are selected in the user selection field, the belonging groups of all those users will be retrieved. Any duplicate groups will be eliminated if multiple users are part of the same group.
It is possible to reference this information from $1 using a formula, but a more typical usage is to combine it with “If user belongs to the specified group or organization.”
To refer to the result using an expression from other actions, refer to the “Response” section in Cybozu’s documentation for the result data structure.
For example, to get the group name of the first affiliated group, write as follows:
= $1.groups[0].name
To set the acquired group in the field of “Set Field Value” or in the group selection field in the field mapping, write as follows:
= $1
Set User Selection Field and Target Field (Optional).
Specify the field in which a user has been selected.
This parameter accepts the following field types:
When selecting fields in the table, retrieval will be performed for each row. However, in this case, if you try to reference the result of the action with an expression like $1, it becomes uncertain which line’s result will be returned. To perform processing on each row in the table, specify Target Field (Optional).
If no users are selected in this field, it will not result in an error, and the result will be obtained with groups being empty.
Use this parameter to set the results to another field. You can omit this parameter if you do not set the results directly in the field but use it in another action.
This parameter accepts the following field types:
When specifying fields within a table, the “User selection field” must also select a field from the same table.
When the destination is set to a group selection field, the currently selected other groups will be cleared, and the group obtained from “Get the belonging group (role) of the selected user” will be selected. If multiple groups are obtained, all will be set.
When the set destination is a Text field, the group name is set. If multiple groups are obtained, the group names will be set as a comma-separated list.
This action is designed to work seamlessly with krewSheet.
If the Target Field (Optional) is specified without omission, it is only supported under the following conditions:
However, there are the following restrictions.
If you omit the “Target Field (Optional)”, it will support regardless of the conditions.
If the user is a guest user, they will be treated as not belonging to any group. Please be cautious, as they are not members of the Everyone group.
When setting Target Field, it can be used on any of the following screens. If used on other screens, it will result in an error during app execution. When the “Target Field” is omitted, it can be used on other screens, such as the record detail screen.