cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

How to create new list items after extracting XML data from repeating section using XPATH?

Jump to solution

Hi All, I've managed to create a responsive form with a repeating section which has two columns called "action" and "action owner" linked to it.  A sample of the XML output is below:

 

<?xml version="1.0" encoding="utf-8"?><RepeaterData><Version /><Items><Item><ActionOwner type="System.String">i:0#.w|<<Domain>>\432XXXXX</ActionOwner><Action type="System.String">This is the first action.</Action></Item><Item><ActionOwner type="System.String">i:0#.w|<<Domain>>\432XXXXX</ActionOwner><Action type="System.String">This is the second action.</Action></Item><Item><ActionOwner type="System.String">i:0#.w|<<Domain>>\byrXXXX</ActionOwner><Action type="System.String">This is the 3rd action.</Action></Item></Items></RepeaterData>
 
I've created a workflow to query the XML and the results I get are as follows:
Output 1
 i:0#.w|<<Domain>>\432XXXXX
 i:0#.w|<<Domain>>\432XXXXX
 i:0#.w|<<Domain>>\byXXXX
Output 2
 This is the first action.
 This is the second action.
 This is the 3rd action.
 
I then use a "For Each" loop to extract the collection data from "Action Owner" in to a variable and I do the same for the "Action" column also in to a separate variable. However, this is where I think I'm going wrong and require some assistance please.
 
I would like to create 3 new items on a separate list.  Essentially this list will allow me to track actions from meeting minutes that have been assigned.  So far I've been able to use the "Create Items" functionality to create 3 separate items against the three different Action Owners but the action associated to these three items is always showing as the last one in the list (for example):
 
ID                     Action Owner                                 Action
Item 1               Name 1                                         This is the 3rd action.
Item 2               Name 2                                         This is the 3rd action.
Item 3               Name 3                                         This is the 3rd action.
 
I've looked at collections, loops, regex etc but I can't seem to figure out how to do this next bit.  Any help / guidance would be most appreciated.
 
Thanks in advance
 
Sean
0 Kudos
Reply
4 Replies
Highlighted
Nintex Employee
Nintex Employee

Re: How to create new list items after extracting XML data from repeating section using XPATH?

Jump to solution

Hi,

The for each action can only handle 1 collection variable and that is why this is only working for 1 of the collections.

Use a a loop instead with a collection operation for each collection that extracts the same Index at the same time, adds them to a variable and creates the item based on the variables.

View solution in original post

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: How to create new list items after extracting XML data from repeating section using XPATH?

Jump to solution
Hi Simon, many thanks for the steer. I'll do some research on this proposal. If you happen to know of any good links that demonstrate this, be great to have a look if not, I will let Mr G Oogle do the heavy lifting and shifting for me. WIll ervert back if I get any joy. Thanks.
0 Kudos
Reply
Highlighted
Nintex Employee
Nintex Employee

Re: How to create new list items after extracting XML data from repeating section using XPATH?

Jump to solution
Hi,

Search on the forum for "parse xml" and you will find a lot of examples.
Reply
Highlighted
Nintex Newbie

Re: How to create new list items after extracting XML data from repeating section using XPATH?

Jump to solution
Thanks for your steer Simon. I managed to find the below post that helped me a lot however, I have come now to a new issue but will raise a separate post for this as the issue is completely different to this.

https://community.nintex.com/t5/Community-Blogs/Queries-and-Collections-and-Loops-Oh-My/ba-p/82404
0 Kudos
Reply