API XML to Excel

Hello All,
I extracted data through API in XML format and need only selected columns of data. I gave build data table with the required column headers and passed in Add data row activity but I’m getting error in add data row activity like "object reference not set to an instance of an object. How to resolve this issue?

Please share with us the XML or let us know more details on the structure and definitions (e.g. XML Namespaces)

Yeah sure
API.txt (2.1 KB)

When this is the XML which we have parsed into a XDocument - xDoc with Deserialize XML

grafik

then we can do:
grafik

we guess the reg_no was targeted, but the element name is found_by as there is no reg_no element (we refer to the code samples from the text file)

In the message box It’s showing the regn_no as in the file. but unable to write the data in the excel

We can recommend to do inspections within debugging and its panels
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

Perfect, so we have solved the Null Object issue and have correct extracted as it was the Topic Scope

Kindly note:

  • we prefer 1 Topic = 1 Case (here extraction)
  • we do not know what was done / modelled
  • debug and trace / inspect the flow

@ISBS_ROBOT

Initial check

  1. Check if the in build datatable if you assigned datatable variable
  2. Check if the values or variables you are using in array row are havinbgt data and are initialized

Cheers

As I have sent you the file in that, I got only vehicle data as I mentioned “Output_String.Element(“response”).Element(“result”).Elements(“vehicle”)” in for each loop but If i want the “hypth” and “insurance” values how should I pass in the for each loop

we can get the / grabt the children e.g. by

For each Activity | item in xDoc.Root.Descendants(“hypth”).First().Elements | TypeArgument: XElement

Also we can do:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.