XML

Update

5min
Document image


The Update action is one of the actions at your disposal to work with XML data.

Update enables you to update an XML input, if the input tag exists, or to insert the input tag, if it doesn't exist, using XPath.

The action will be able to update data from an XML input using an XPath expression.

Update was previously called XML Update.



Overview

The action is used to update the XML data that we will import into our process for future use.

Input xml string - Input your XML schema in a process variable of type string

Input xml file - Input your XML file in a process variable of type file

Xpath expression - Input XPath expression for obtaining the key value(s) for your XML input

Xml tag - Input XML tag you want to update or insert

New value - Input new value to update the XML node

File name - input file name if you want to store the new XML in a file. The .xml extensions will be automatically added.

String result - returns the new XML as a string

File result - returns the new XML as a file



How to configure the Update action?

1. Create a process and give it a name.

2. Drag the update action to the canvas and link it to the other actions.

Document image


3. Create the variables needed for the configuration of the action, and then add them to the configuration panel:

Document image


In New Value we added "Great Gatsby" which will be updating the title of book[1],. i.e. "Harry Potter".

4. Save, Validate and Run the process.

5. The process will ask for inputs: (see values with example purposes below)

xmlString:

XML


xPath:

XML


6. Click Run.

7. Click Check Instance to view the results. You will see the new XML string saved in the result variable. The title of book[1] is updated to "Great Gatbsy".

Document image




Updated 16 Feb 2024
Doc contributor
Doc contributor
Did this page help you?