DATA FORMAT Set XML function

The DATA FORMAT Set XML function in RPA.

Help CentreFunctions & 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:

  1. Navigate to the process where you would like to add the Set XML function
  2. Click on the green button’s drop-down (right side of the green button labelled “Process”)
  3. On the menu that appears, click on the “+ Activity” item
  4. From here you can select the DATA FORMAT Set XML option
  5. Click "Add" once you are done

Input parameters

ParameterRequiredTypeDefaultDescription
DataYesText-The XML string to modify
XPathYesText-The XPath expression to match elements
ValueYesText-The value to set as the text content of matching elements
VariableNoTextdataVariable name to store the modified XML

Output variables

VariableTypeDescription
{data}StringThe modified XML string

Errors

ErrorDescription
Invalid XMLThe data is not valid XML
XPath errorThe XPath expression is invalid

Tips

  • Sets the text content of all matching elements
  • Use specific XPath expressions to target individual elements

Related functions

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.