How do we check the data is available in the XML file?

Hello,

I was trying to extract the data from the XML file, The attributes/ fields not sure its repeated or no.
If the field is not available then its throwing an error.
Can some help me to fix this.

Example:

ABC
ABCD
M
12345


ABC
ABCD
12345

in this the gender is not repeated, so can you tell what activity to use to skip that and go forward.

Hi @Nandhish_Srinivas

Could you workflow? or the screenshot of the activity where you are facing an issue?

Regards

Assign: Object reference not set to an instance of an object. this is the error,

when i dont find the attribute im getting this error

Hi @Nandhish_Srinivas

Have you using any if condition to check whether the gender is present or not?

Regards

No im not using any condition.

Can you share the workflow @Nandhish_Srinivas

Regards

Not able to share the file here, getting an error
Sorry, new users can not upload attachments. Please see here how to remove this restriction:

Okay can you please try sharing the screenshot @Nandhish_Srinivas

Regards

Even screenshot im not able to screen Varun. Since its company laptop, i guess im restricted.

Can you explain the flow how did you wrote the code and all @Nandhish_Srinivas

Regards

Sure.

  1. Im reading the XML file and storing it in output variable.
  2. then using Deserialize XML
  3. build the data table
  4. using for each Xoutput.Element(“CONSOLIDATED_LIST”).Elements(“INDIVIDUALS”).Elements(“INDIVIDUAL”)
  5. in the body im using assign : item.Element(“REFERENCE_NUMBER”).Value
  6. add data row to insert the data in DT