Want to read the specific report from the XML

@ppr - mylist is not empty, its having the data.
What to do after that to check further?

OK Here WE go:
With yourlistvar.ElementAt(1).Element(“name”).Value.ToString

WE accessing the Second food element and retrieving the Name element value

@ppr - it worked and given the result as = Strawberry Belgian Waffles
But what if i want to read name, price,description, calories at a time from below how to do it? lets assume its second element and output should like, Strawberry Belgian Waffles, $7.95,Light Belgian waffles covered with strawberries and whipped cream,900

In general that will Not be an issue, latest on saturday i can Setup for you a Demo xaml.

In the meanwhile Let US summarize Our steps so far.

Retrieving all food Elements:
Returns a list of xelement

Retrieving the Second food element
Returns a xelement

Myfoodelementvar.element(“name”).value.to String
Returns the value from the Name element

For retrieving the Other element values you have two options:

  • Hard coding
  • Iterate over all direct children of food element

Myfoodelement.elements().tolist should return alll direct children. Give a try on this and incorporated IT for Test purpose within a for each activitY an Log Out element Name and value

Any questions so far?

@ppr - Till now im fine, i got it what you are trying to explain. But im not able to implement it.
I can wait till Saturday. Thank you so much for your help and support.

OK lets do IT Like this.
Can you please Help me on some requirements

  • What is the purpose of Reading Out the values. Do you want to Store IT later in an Excel
  • You were asking for the Second element. Is There any constraintsbto Filter for a particular food

Thanks for your answers

@ppr- Here are my inputs-
1. What is the purpose of Reading Out the values. Do you want to Store IT later in an Excel- Yes
2. You were asking for the Second element. Is There any constraintsbto Filter for a particular food- Its not like that but sometime it may requirement to get data only for particular element e.g. second or third element.

Perfect, thanks for answering.
Once i am Back at Home i will Setup a Demo xaml and will Share it with you

@ppr- Sure, Thank you.

Demo XAML here:
vaibhav2.chavan.xaml (14.4 KB)

it is showcasing following:

  • retrieval of all food elements
  • accesing particular food element by Index
  • accesing particular food element by name
  • retrieving a list of all food names
  • dynamic reading the food info (name, price … ) into a dictionary
  • creating dynamicly a datatable with the columns same as food info (name, price…)
  • export of the food info into a datable

Kindly note:

  • rewire the path to xml as it is at your end

In principal this demo shows more functionalities as in this topic were asked. So lets finalize this thread and do open new topic on new detail questions.

Let us know your open questions and mark the solving post as solution. So others can benefit from it

@ppr - Thanks again for sharing the XMAL. I will check and let you know in case of any clarification.

@ppr - After opening the xmal file in Studio im getting below message - This activity is either missing or could be loaded properly.

@ppr - I have added the required dependencies and now i can able to run without any issue.

Ensure that you have placed the xaml within a UiPath Studio project.

Your dependencies are incomplete. Add

Perfect, Happy automation :grin:

@ppr - Thank you, looking forward more support from you :slight_smile:

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