Some business processes may consume the XML as an input/output to exchange data to/from a web server.
When receiving data from a web server, the data is always a string.
Let’s explore how to extract the field from an XML string!!!
Implementation using UiPath :
Let us implement a workflow which reads a .XML file and extracts the required fields.
Drag “Read Text File” activity into the designer panel, pass the .XML file’s path to it and save the output to a string variable.
Please download the sample .xml file from the link mentioned at the bottom of the article.
Drag “Deserialize XML” activity into the designer panel to deserialize XML string. Supply the variable “xml_Data” to it as input and create a variable called “out_XML” of XDocument type.
Note: If you don’t find the “Deserialize XML” activity in the activities panel, then you have to install UiPath.Web.Activities package
Drag “For Each” activity into the designer panel and supply the below-mentioned parameters into it.
Use “Message Box” activities to display the contents.
Finally, run the project 🙂
Click here to download the Source Code…
Hope it has helped you…