Get each elements in xml and store them individually in a variable

Hello. I want to know how to get each “family” element alongside its children and store them individually in a variable? (please see image below)

The output that I want looks like this:
variable 1 = node values on first family element (Julie, Monty, Clark, Isabel)
variable 2 = node values on second family (JClarice, Robert, Jesse, Marie)
variable 3 = node values on third family (Juliana, Bart, Margie, Mario)
and so on and so forth since the number of family element per xml file might vary (more or less)

Can somebody help me accomplish this? Thank you.

Hi @Bruskie143 ,
You can try

Regards,

Hi @Bruskie143

Hope it helps!!

Hello. To be honest, it made me confused and I think it’s different in a sense. If possible, I would like a detailed explanation on how can I accomplish my issue. Thank you for the shared post though.

Hello. To be honest, it made me confused and I think it’s different in a sense. If possible, I would like a detailed explanation on how can I accomplish my issue/blocker. Thank you for the shared post though.

I think first need to convert xml file into data table with 4 columns(Mother,father,brothers,sister) then u can assign each row as an array to an array_variable…

Actually, I use Deserialize XML activity on this one. In this case also, I want to add an identifier/ID for each family element that will be assigned so I don’t think array variable is the solution here.

we do not recommend to store each family on a separate variable, as the occurrence of family/family count can be dynamic.

In general we do:
grafik

  • output: xDoc | DataType: XDocument

For getting all family elements: xDoc.Descendants(“family”) eg. for feeding a for each activity for looping

For getting all family members as Text e.g. from the second family:
grafik

A good strategy could also be a List of Dictionaries

Prototypes were done within immediate panel:
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum