Solved

How to write data back to a repeating section


Badge +6

Good day fellow Nintexers.  I need your brains to help me on this one.  I'm trying to figure out how to write data back to a repeating section for a much larger application, but have built a test case for simplification of learning.  Here is my scenario:

 

I have a repeating section bound to a Multi-line column.  In my repeating section I have 3 Single Line of Text boxes titled "First Name", "Last Name" and "Full Name".  I want to enter a first name (Obi Wan) and then a last name (Kenobi) and start with "Full Name" being blank.  The work flow already gets the XLM, divys up the data into two collections.  I can even build the collection called FullName that consist of the union of the two (Obi Wan Kenobi).  What I cannot seem to do is correctly write back this data to my repeating section. 

 

It works fine for one name, but if I have multiple it either applies the very last full name to each "Full Name" location on the list or plugs in the entire collection varible to each "Full Name" location. 

216882_pastedImage_1.png216883_pastedImage_2.png

 

I cannot figure out how to write the data back to the specific index where it should be.  Below is the screenshots of my flow.  What else do you need?

216893_pastedImage_3.png216894_pastedImage_4.png216895_pastedImage_5.png216896_pastedImage_6.png

icon

Best answer by eharris04 11 November 2019, 07:54

View original

4 replies

Userlevel 4
Badge +9

What you have to do is store the XML in a multiline plain text field.
You will have something like this:


<?xml version="1.0" encoding="utf-8"?>
<RepeaterData>
<Version />
<Items>
<Item>
<Lastname type="System.String">Kenobi</Lastname>
<Firstname type="System.String">Obiwan</Firstname>
<Fullname type="System.String"></Fullname>
</Item>
<Item>
<Lastname type="System.String">Organa</Lastname>
<Firstname type="System.String">Leia</Firstname>
<Fullname type="System.String"></Fullname>
</Item>
<Item>
<Lastname type="System.String">Solo</Lastname>
<Firstname type="System.String">Han</Firstname>
<Fullname type="System.String"></Fullname>
</Item>
</Items>
</RepeaterData>


In your workflow, just query XPath to get the 3 items, and get the firstname and the last name.
You can now update the XML from the item with your new value, by doing a update XMl or a string replace for example :
Replace '<Fullname type="System.String"></Fullname>' with '<Fullname type="System.String">{varFirstname} {varLastname}</Fullname>'
Create the new XML to store in your loop.
You then just have to update your field with the new value of text.

Badge +17

thanks @allan for the response. @cbeene did this solve your issues or help you out?

Badge +6

Wierd thing, I never saw Allen's response.  



I did get it fixed two weeks ago however and should have reported back here.  


 


It was a rookie mistake.  I have security actions by line item in the WF.  I couldn't write back to the list AFTER the WF ran once on that item because I didn't have permission.  Thanks for everyones help however.  

Badge +17

@cbeene can you mark which response closely solved your problem, if none, then mark your resolution as the main one.  Thanks and glad you got it working.

Reply