Help Centre › Functions & Formulas
This article describes the RPA Data Format functionality to set values in XML data.
For a full list of available functions, please read DATA FORMAT functions.
Description
The Set XML function sets the text content of XML elements matching an XPath expression. All matching elements are updated with the specified value.
Setting it up
To use the Set XML function, follow these instructions:
{{popups:rpas/add:action=xml-set}}
Once on a process map:
- Navigate to the process where you would like to add the Set XML function
- Click on the green button’s drop-down (right side of the green button labelled “Process”)
- On the menu that appears, click on the “+ Activity” item
- From here you can select the DATA FORMAT Set XML option
- Click "Add" once you are done
Input parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
| Data | Yes | Text | - | The XML string to modify |
| XPath | Yes | Text | - | The XPath expression to match elements |
| Value | Yes | Text | - | The value to set as the text content of matching elements |
| Variable | No | Text | data | Variable name to store the modified XML |
Output variables
| Variable | Type | Description |
|---|---|---|
| {data} | String | The modified XML string |
Errors
| Error | Description |
|---|---|
| Invalid XML | The data is not valid XML |
| XPath error | The XPath expression is invalid |
Tips
- Sets the text content of all matching elements
- Use specific XPath expressions to target individual elements