Skip to main content
Nintex Community Menu Bar
Solved

Query XML for Repeating Section - how to set up correctly?

  • January 24, 2022
  • 2 replies
  • 874 views
  • Translate

MikeCrawford
Forum|alt.badge.img+3

This has been discussed ad nauseum in countless threads, but I cannot for the life of me find how to correctly provision the workflow to iterate through the collection.

 

Let's say I have a repeating section with a single text field that a user can add to.

21492i552CDEE4B3E77F48.png

The xml will look like this, in my RepeatingSection column (plain text, multiline):


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

<RepeaterData><Version />

<Items>

<Item><Thing type="System.String">First thing</Thing></Item>

<Item><Thing type="System.String">Second thing</Thing></Item>

<Item><Thing type="System.String">Third thing</Thing></Item>

</Items>

</RepeaterData>

 

I know I need to use Query XML to get the collection information, but I don't know how to set it up correctly. I can drill down to the "Thing" item that I want, but do I keep the [1] as the index when initially querying? If I set it to a WF variable, it doesn't work.

21493iE5E852428976629A.png

Here are my variables:

21494iAA91009F8291628E.png

My For each loop performs a Collection operation to Get items from the collection (at least that's the idea)

21495iAE0A4267D6D20B49.png

Here is the For each:

21496i875F325084D87B4F.png

And the Collection operation:

21497iF77797F8BD261F4E.png

Which should update another plain multiline with the Thing(s) texts:

21498i8DEC7CCD2AC27170.png

Except it only grabs the first item, which is "First thing" and helpfully logs: "Index 0 has thing First thing" which is correct but not exactly what I want. 


Why is it not looping through the collection?

Best answer by Aleximo

hey @MikeCrawford ,

 

I would set it to: //Items/Item/Thing

 

rest of ur workflow looks fine.

 

 

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+8
  • 93 replies
  • Answer
  • January 25, 2022

hey @MikeCrawford ,

 

I would set it to: //Items/Item/Thing

 

rest of ur workflow looks fine.

 

 

Translate

MikeCrawford
Forum|alt.badge.img+3

Hey thanks @Aleximo ! Turns out it was as easy as identifying the //Item, since that's the only thing in the node. For "real" items with more fields, your suggestion will work perfectly. Thanks!

The For loop and Collection operation were configured correctly.

 

My biggest trouble is finding good, pertinent examples on this Community site. I wish the documentation had some examples.

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings