Applies to: NITRO Workflows and Custom Actions (Online)
For complete list of functions, please refer to this article.
Introduction
This function can be used to append value to a collection. For example: Add a user to an existing collection of users in a multi-user column. Supported column types to add value are multi-user, multi-lookup and multi-choice. Appended values can also be saved in text type columns.
Syntax:
With Expression Builder Ex:
To use ‘Append’ function without expression builder use below syntax:
$append(lookup/lookupid/lookupvalue/user/userid/uservalue/multichoice/string,separator,[placeholder],[placeholder])
Parameters to be defined in above function:
Param1- Lookup/LookupId/LookupValue/User/UserId/UserValue/MultiChoice/String:
S. No. | Parameter Value | Description |
1 | Lookup | Target column is of type multi-lookup. |
2 | LookupId | Target column is of type multi-lookup. Or target column is of type text and only lookup item Ids are required. |
3 | LookupValue | Target column is of type text and only lookup item display values are required. |
4 | User | Target column is of type multi-user. |
5 | UserId | Target column is of type multi-user. Or target column is of type text and only user Ids are required. |
6 | UserValue | Target column is of type text and only user display values (name of user) are required. |
7 | MultiChoice | Target column is of type multi-choice. |
8 | String | Target column is of type text. Or target is a variable. |
Param2- separator:
For ‘String’ type output or when target is a text type column or a variable, specify the separator for the values. Multiple values separated by specified character can be used in scenarios where such a list needs to be passed to external systems via Invoke Web API action. Or data must be converted to specified format and saved to text type columns.
Param3- [Placeholder]:
Specify column placeholder, fixed value, or variable for input values.
Param4- [Placeholder]:
Specify column placeholder, fixed value, or variable for input values.
Click ‘+’ (available in right side of Append Function in EB) to add more parameter in the function. These parameters can be a column placeholder, fixed value, or variable for input values.
Please refer to below table for scenarios and corresponding parameters for the append function.
Scenario Description | Target Column Type / Variable | Param 1 | Param 2: Separator | Param 3: [Placeholder]/Fixed Value/Variable | Param 4: [Placeholder]/Fixed Value/Variable | More Parameters | Output Example |
Add values from a lookup column to a multi-lookup column. | Multi-Lookup Column to which value needs to be added Ex: [LookupMultiCategory] | Lookup | Not Required | Same as target column: [LookupMultiCategory] Value before append: Calendar;Email | Column whose value need to be added. Value in this column will not change. Column: [LookupSingleCategory] Value: Finance | NA | Value in target column after append: Calendar;Email;Finance |
Get a comma separated list of lookup column Id values from two or more lookup columns. | Variable/ Text columns to which value needs to be added Ex: [TextLookupId] | LookupId | , | Same as target column: [TextLookupId] Value before append: Ex: 6 | Column whose value need to be added. Value in this column will not change. Column: [LookupMultiCategory] Value: Calendar;Email | Column whose value need to be added. Value in this column will not change. Column: [SingleConverted] Value: 1 | Value in target column after append: 6,4,5,1 |
Get a semicolon separated list of lookup column display values from two or more lookup columns. | Variable/Text Column to which value needs to be added Ex: [TextLookupValue] | LookupValue | ; | Same as target column: [TextLookupValue] Value before append: Ex: Desktop | Column whose value need to be added. Value in this column will not change. Column: [LookupMultiCategory] Value: Calendar;Email | Column whose value need to be added. Value in this column will not change. Column: [SingleConverted] Value: Hardware Request | Value in target column after append: Desktop;Calendar;Email;Hardware Request |
Add values from a user column to a multi-user column. | Multi-User Column to which value needs to be added Ex: [UserAndGroupMulti] | User | Not Required | Same as target column: [UserAndGroupMulti] Value before append: Ex: TemplateTest3 Members; Maria Clark | Column whose value need to be added. Value in this column will not change. Column: [UserAndGroupSingle] Value: Joe Bloggs | NA | Value in target column after append: TemplateTest3 Members;Maria Clark; Joe Bloggs |
Get a semicolon separated list of user Id values from user column and fixed value. | Variable/Text Column to which value needs to be added Ex: [TextUserId] | UserId | ; | Same as target column: [TextUserId] Value before append: Ex: 129 | Column whose value need to be added. Value in this column will not change. Column: [UserAndGroupMulti] Value: TemplateTest3 Members; Maria Clark | Fixed Value Ex: 26 | Value in target column after append: 129;140;153;26 |
Get a semicolon separated list of user display values from user column and fixed value. | Variable/Text Column to which value needs to be added Ex: [TextUserValue] | UserValue | ; | Same as target column: [TestUserValue] Value before append: Ex: Scott Restivo | Column whose value need to be added. Value in this column will not change. Column: [UserAndGroupMulti] Value: TemplateTest3 Members; Maria Clark | Fixed Value Ex: James Restivo | Value in target column after append: Scott Restivo; TemplateText3 Members;Maria Clark;James Restivo |
Add values from a choice column and variable to a multi-choice column. | Multi-Choice Column to which value needs to be added Ex: [DepartmentMulti] | MultiChoice | Not Required | Same as target column: [DepartmentMulti] Value before append: Ex: Sales,HR | Column whose value need to be added. Value in this column will not change. Column: [DepartmentSingle] Value: Marketing | Variable: [varDepartment] Ex: Electronics | Value in target column after append: Sales;HR;Marketing;Electronics |
Get a comma separated list of choice column values from two or more choice column | Variable/Text Column to which value needs to be added Ex: [TextString] | String | , | Same as target column: [TextString] Value before append: Ex: Finance | Column whose value need to be added. Value in this column will not change. Column:[DepartmentMulti] Value: Sales,HR | Column whose value need to be added. Value in this column will not change. Column: [DepartmentSingle] Value: Marketing | Value in target column after append: Finance,Sales,HR,Marketing |
Other supported Scenarios | |||||||
Add values from a user column and fixed value to a multi-lookup column. | Multi-User Column to which value needs to be added Ex: [MultiUserWithUserId] | UserId | ;#;# | Same as target column: [MultiUserWithUserId] Value before append: Ex: TemplateTest3 Members; Maria Clark | Column whose value need to be added. Value in this column will not change. Column: [UserAndGroupSingle] Value: Joe Bloggs | Fixed Value: 70(Id of Demo Site Members) | Value in target column after append: TemplateTest3Members; Maria Clark; Joe Bloggs; Demo Site Members |
Add values from a lookup column and fixed value to a multi-lookup column. | Multi-lookup column to which value needs to be added Ex: [MultiLookupWithLookupId] | LookupId | ;#;# (For getting multiple Lookup id use this separtor) | Same as target column: [MultiLookupWithLookupId] Value before append: Ex: Calendar;Email | Column whose value need to be added. Value in this column will not change. Column: [LookupSingleCategory] Value: Finance | Fixed Value: 6(Id of Printer) | Value in target column after append: Calendar;Email;Finance;Printer |
Note:
- In NITRO Workflows: For users, to append a hard-coded user, specify one of the below user attributes:
- DisplayName
- Id
- In Custom Actions: For users, to append a hard-coded user, specify the ‘ID’ attribute of the user or SP Group or AD Group.
Example of Append Function:
In Custom Actions, Configure Append Function in Column Mappings of Update Item Action.
- Configure Update item custom action
Define Variables
Configure ‘Append’ function for different types of columns as shown below:
Configure Column Mapping for ‘TextLookupValue’ column using Expression Builder as shown below:
Similarly, configure other columns mappings using Expression Builder.
Item column values before running the custom action:
Item column values after running the custom action: