How to parse a repeating section xml with for each action?

  • 10 January 2018
  • 2 replies
  • 6 views

Badge +10

Hi all,

I have a xml as a result of a repeating section:

<?xml version="1.0" encoding="UTF-8"?>

<RepeaterData> <Version /> <Items>

<Item>

   <Artikel type="System.String">22</Artikel>

   <Stückzahl type="System.String">2</Stückzahl>

   <Mitarbeiter type="System.String" />

</Item>

<Item>

   <Artikel type="System.String">5</Artikel>

   <Stückzahl type="System.String" />

   <Mitarbeiter type="System.String">Peter</Mitarbeiter>

</Item>

<Item>

   <Artikel type="System.String">5</Artikel>

   <Stückzahl type="System.String" />

   <Mitarbeiter type="System.String">Anna</Mitarbeiter>

</Item>

</Items>

</RepeaterData>

Now I want to parse that xml with a for each action. Currently I am using a Loop action which I want to replace.

How can I do that? I would guess that there is some out-of-the-box solution for that?!

Cheers

mai-kel


2 replies

Userlevel 5
Badge +14

first you have to use Query XML action and using a XPath expression parse out respective attributes, values or nodes.

save the result to collection variable.

then you can use for each loop to iterate over the collection variable and process its single elements

Badge

Do you happen to have a sample workflow i can use to familiarize myself with this concept. I dont have great XML skills and I am also using the current Query XML in O365?

Reply