Create XML Variable
- Last UpdatedJul 01, 2024
- 3 minute read
In the Web API Activity Configuration window, use the Create New option in the dropdown list of Save output in to create a new XML Variable.
Note: The value returned from a Web API should have a valid and non-localized JSON. In the case of localized JSON, store the returned value in a String Variable instead of an XML Variable.
To create XML Variable for Generic Web API
In the Web API Activity Configuration window,
-
Enter the required data i.e. HTTP Method, Parameters (if not optional), Content Type, and Post Data.
-
Select the XML Variable in the Save output type dropdown list.
-
Select the Create New option in the Save output in dropdown list.
The Create Web API XML Variable window opens.
-
Enter the name for the XML Variable. The XML Variable name with a single character is not supported.
-
Select the Yes check box for Always include ChildNode in the XML schema to add ChildNode under Root node to hold multiple items.
Note: If the Web API selected for creating XML Variable returns multiple nodes, it will add the ChildNode node by default. But if you select the Yes checkbox and if the Web API returns even a single node, it will add the ChildNode node. This is applicable only for JSON returning Web APIs and not for XML returning Web APIs.
-
Under Parameters tab, enter the values to be passed against the listed parameters.
-
Click Save.
Note: The Web API will be executed in the Web API server during this operation. Based on the Web API functionality, there is a possibility of data update or delete.
To create XML Variable for OpenAPI:
In the Web API Activity Configuration window,
-
Select the Operation to be performed.
-
Select the XML Variable in the Save output type dropdown list.
-
Select the Create New option in the Save output in dropdown list.
The Create Web API XML Variable window opens.
Note: If the selected Operation does not have any response in the specification, it displays the message "the Operation does not return any value" and does not open the Create Web API XML Variable window.
-
Enter the name for the XML Variable. The XML Variable name with a single character is not supported.
-
Select the Yes check box for Always include ChildNode in the XML schema to add ChildNode under Root node to hold multiple items.
Note: If the Web API selected for creating XML Variable returns multiple nodes, it will add the ChildNode node by default. But if you select the Yes checkbox and if the Web API returns even a single node, it will add the ChildNode node. This is applicable only for JSON returning Web APIs and not for XML returning Web APIs.
-
Click Save.
Note:
- The supported data types are boolean, decimal, numeric, and string.
- XML Variables without root elements are created with a root node named root. In earlier versions, it was Root. In case of upgrade and if XML Variables are updated, then correct this change in
respective activities and variables. Mainly affected in Xml Variables of type Iterator,
Activities like Script, Update Variable, and properties using Expression Editor.