Update XML

Alters XML data.

This action can be used to alter an XML file that the workflow is running on, including InfoPath forms.

Action Settings

XML source

Specify the location of the XML to alter. A copy of this XML data is processed by the workflow action. Select one of the following options:

  • Current item: The item that the workflow is running on will be used as the source. This option is available for workflows designed on libraries only.
  • URL: Data located at a nominated URL will be used as the source. A username and password can be provided for the request. If no username or password is provided, the request will be anonymous.
  • XML: Specify text or inserted references as the XML source.

Updates

A number of update operations can be performed by a single Update XML action.

XPath query

The XPath query to the XML nodes that will be altered. The XPath query can resolve to a single node, or a node list. If the result is a node list, the selected change will be applied to each node. Click on theXPath Builderbutton to use the XML browser to navigate the XML structure and select an element from the XML data.

Note: If the XML source specified for the action is available and all tokens and references are replaced with actual run time values, then the XPath Builder will use the XML source to display the XML structure within the XML browser. Otherwise, sample XML data will need to be provided in order to select the node using the XML browser.  

Selected node(s) action

The operation to perform on the selected node. Select one of the following options:

  • Replace node contents: Replace all content within the XML node with the supplied value. 
  • Add child node: Adds a new node from the supplied XML fragment.
  • Set node text: Sets the value of the XML node to the supplied text.
 

Add XML update: Select to define another update operation.

Store result in

Specifies where the resulting XML should be stored. Select Workflow variables type or choose from the following options:

  • Current item: The contents of the item on which the workflow is running will be overwritten with the new XML. Use this to update InfoPath form items. This option is available for libraries only.
  • URL: The XML will be stored at a location specified by a URL. The URL does not have to point to a SharePoint location.

Troubleshooting

Action not executing

The work load for this action is added to a job queue. The workflow executes jobs in the queue as a batch when it reaches a "commit" point. For more information, see the Nintex article "Commit Pending Changes in Workflow Design."  

Related information

Find, add, and configure actions