Looping through XML String?

Hello,

I just have a quick question that I’m sure someone knows the answer to but I cannot find.

I have essentially an XML file stored into a string that follows the following format:
image
My goal is to be able to loop through this and do things which each of the s.
How would I go about doing this?

Thank you :slight_smile: !

Hi
Did we try with DESERIALISE XML activity

For that go to design tab in studio-> manage packages -> official tab -> search and install UiPath.Web.Activities

In that we will be having the activity in activity panel

Once after getting the output from this activity as a xml document use a FOR EACH activity to loop through each tags
For example

Cheers @rileythiessen

1 Like

Awesome that worked perfectly.
One more quick question, when I loop through the XMLDocument.Element(“collection”).Elements(“event”) and then i extract the item.Element(“test”) in this case it returns

< test >blahblah< /test >

is there anyway to have it return just what is inside without having to use regex?
If not, there is a way to extract that using one assign activity + regex right?

Thanks!

I went and typed this out quick to see, and there’s a list of properties you can use with the xml object. So just type a period next to your code, and you will see that there is “Value”. That should give you what’s inside. If not, try other items in that list.
image

Regards.

Beautiful that worked! Thank you so much :slight_smile:

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