Solved

Update Repeating Section XML

  • 9 February 2018
  • 7 replies
  • 55 views

Badge +9

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?

 

213338_pastedImage_1.png

213334_pastedImage_1.png

icon

Best answer by furstlars 14 February 2018, 01:34

View original

7 replies

Userlevel 5
Badge +14

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
Badge +9

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.

Badge +9

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.

Userlevel 5
Badge +14

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.

Badge +9

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.

Userlevel 5
Badge +14

right, that seems to be the proper approach.

I realize this is an old post, but does this also work in O365?

Reply