How to change a XML file to excel format

Hi All:

Now, I have a XML file. It can’t be directly read by people. Usually, I will open a blank excel, then I will open the XML file in this excel. How about the UiPath. I mean, if there has some activities can change the format about the XML file to excel file?

Thanks in advance!

@Harvey

I think you can try like this,

You read the xml file , access all the values and store it in a Dictionary.
Then Write those values in Excel.

Regards,
Mahesh

Which activity can read the xml file? Because, if I open the XML file, it’s a XML format. So…

@MAHESH1

Hi @Harvey,

Please refer the below xaml file
xmlToDt.xaml (6.0 KB)

DataSet ds=new DataSet()
ds.ReadXml("YourXmlfilepath")

Regards,
Arivu

Hi @arivu96 ,

I used your solution, but I am getting only, lets say, first row of the xml and not the full list of columns. Do you have any ideas, how can I solve this problem?

Regards

The solution mentioned converts the XML to a dataset, which is going to be a collection of datatables. This is a good solution if, as the original question asked, you want to extract out ALL data from the XML, flatten it out, and paste it into excel. Note that you’d want to loop through each datatable in the dataset if there are multiple children in the XML, as each child becomes one datatable when converting XML to dataset.

If you are trying to extract out specific values, it is much better to use deserialize XML activity instead. This allows you to navigate the document and choose specific elements, nodes, values, etc from the XML document and also allows you to use XPath expressions.

Can u share the workflow…
I have deserialized …but I’m not getting how to extract it to Excel

With an XML there is usually specific data to be extracted. Deserializing XML allows UiPath to read it as an XDocument type to find and extract that data more easily. If you can be more specific about what you’re trying to achieve perhaps we can help?

I want to read XML and print it out on excel

Hi can u explain
DataSet ds=new DataSet() ds.ReadXml(“YourXmlfilepath”)
What Is this line for… And where I have to enter in workflow…
Thanks