cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Update Repeating Section XML

Jump to solution

Can anyone explain how to update the XML in a repeating section? This existing post does nothing to describe it in detail.

My form/workflow at this point:

  1. WorkActivities multiline textfield that store the repeating section XML.
  2. Status is a XML node/calculated field with color names (Green, Amber, Red). A script on the list page converts the text to the colored circles below.

2. My workflow is currently able to loop through the entire list and also loop through the repeating sections to do other things I want it to do (for e.g. check Activity Due Date and send notification emails).

3. How do I use the Update XML action to update each repeating row's Status?  The method I'm using below updates only one row despite incrementing the IndexRepeaterRow variable in the XPath, after the loop. What am I missing?

Labels: (1)
0 Kudos
Reply
6 Replies
Workflow Hero

Re: Update Repeating Section XML

Jump to solution

your XPath expression and whole action configuration seems to be correct.

so if you correctly handle loops and correctly increment index it should work. but that's hard to guess from what you have provided.

however, if you want to update all the statuses within repeating section (from one list item) you need not to do extra looping over repeating section rows. single update with XPath like following would do the job.

//RepeaterData/Items/Item/TrafficLightText
0 Kudos
Reply
Workflow Hero

Re: Update Repeating Section XML

Jump to solution

That's what I thought - no extra looping required. But if I don't all the lights get updated to the same text/color.

I'll keep investigating and find out what the issue is.

Reply
Workflow Hero

Re: Update Repeating Section XML

Jump to solution

I found out what was causing the issue re same color.

Onto a different issue altogether:

I discovered that updating the individual repeating XML is not enough. The new colors will not show up in the list if I do not follow it up with an Update Item action when the loop is finished.

But how do I write back the individual updated repeating row XML back to where it originally was in the XML collection? There're also conditions involved as far as changing the colors go.

0 Kudos
Reply
Workflow Hero

Re: Update Repeating Section XML

Jump to solution

of course, Update XML action updates just a workflow variable, not the list item itself.

updating changed value back in collection variable will not help you with updating list items since there is no action that would make an update of multiple list items by a source collection. you will have to make updates item by item, with a (XML) variable value, within the loop - can be the same loop that makes  XML update.

0 Kudos
Reply
Workflow Hero

Re: Update Repeating Section XML

Jump to solution

I think I may have discovered the solution.

Instead of using each repeating row's XML as the source, I'm now using the entire XML in the multiline column instead, and using a function within the XPath to implicitly target the rows that need updating.

0 Kudos
Reply
Workflow Hero

Re: Update Repeating Section XML

Jump to solution

right, that seems to be the proper approach.

0 Kudos
Reply