JaredA
Scholar

Repeating section data into SharePoint List column

Hi all,

 

 

I am currently working on a Sharepoint list where i am using nintex forms to help with the functionality.
In this list the user needs to be able to add as many machines that they are using for a job with all the needed info required by the company. For this i decided to use the repeating section within nintex.
In the repeating section i have columns such as Description, Weight, Dimensions, How is the machine powered, etc.
But nintex doesnt have an out of the box solution how this data can be easily stored in the columns of my Sharepoint List.
I have tried looking for a solution on this forum but the answers i got were either out of date or were too complex for me too understand (Total noob to nintex).
Repeating section data gets saved as XML and i want to extract this data and put it into the relevant columns of the Sharepoint List.
Can anyone help me walk through this problem and how i can solve it? (I am using the new responsive designer btw)

 

Many thanks in advance,

Jared

Labels: (1)
0 Kudos
Reply
7 Replies
leighburke
Nintex Employee
Nintex Employee

Re: Repeating section data into SharePoint List column

@JaredA You will need to parse the xml, there is a sample and example here(http://workflowexcellence.com/nintex-workflow-parsing-nintex-forms-repeating-section-in-office-365/). The main difference in new responsive is the names of the field will be guid's like the following(_8eb4d91752f381f525f0dbf08da6a794) rather than a name mentioned in the example.

0 Kudos
Reply
JaredA
Scholar

Re: Repeating section data into SharePoint List column

Hey @leighburke

I'm still having some problems.

-I already connected the repeating list to a multiple lines of text column, so all the regular expressions in the example where he replaces the patterns isn't needed if i'm correct? Or do i still need to do all of that?

-I am also still struggling with using the XPath query's. Like you said the names of the fields will be GUID's but i dont know how to use them in the XPath. If i try to use it like the example (//Item/"GUID here") it doesn't seem to work.

-My main problem is that i want to extract the data and put it into their respective existing columns in the SharePoint list. From my little understanding of this, with the example above i am only collecting the data from the XML and storing them in a variable. How do i get Nintex to place the collected data into the list columns? (if it's even possible)

Sorry for the long (and maybe stupid) list of questions, i am very new to nintex (and IT for that matter) and could really use some help.

Thanks,
Jared

0 Kudos
Reply
ajcrow
Scholar

Re: Repeating section data into SharePoint List column

Hey Jared,

 

Couple of things first.

1. Copy the XML from your form output into a notepad file with the extension ".xml". (You hinted this might be connected to a SP list column?)

2. On the workflow side, you will now want to configure a Query XML action. In this action,

  • You will need to get the count of the items in the repeating section first before parsing the data.
  • To do this, change the XML source to XML
  • For XML use the SharePoint list column reference that is storing the XML. 
  • For output, the format will be something like, "/RepeaterData/Items/Item
    • NOTE: If this path is different, you can upload your XML file into the Xpath builder and determine the correct path. 
  • Output this result into a collection variable called colRepSection or something similar.

3. Add and configure a collection operation. In this action,

  • Change the target collection to colRepSection or whatever you named the collection variable.
  • Select count, and store this in a variable called numItems variable of type number.

4. Add a set variable action where you set a new variable titled "Counter" of type integer to a value of 1.

5. You will then want to start looping through the data. Create a loop action with the following values,

  • Condition: If any value equals value
  • 'Workflow data: Counter' 'is less than or equal to' 'Workflow data: numItems'

6. Add and configure another Query XML action. In this action,

  • Change the XML source to XML
  • For XML use the SharePoint list column reference that is storing the XML. 
  • For output, the format will be something like, "/RepeaterData/Items/Item[{WorkflowVariable:Counter}]/'XML FIELD NAME'. Where WorkflowVariable:Counter is the variable established earlier on in this document.
  • Output this result to the single line text variable of your choosing.

7. Use this SLT to update any list item of your choosing. I usually output the results of a repeating section to a different list.

8. Add a math operation and add 1 to the workflow counter variable. 

9. This should close your loop.

 

I like yourself, am also new to Nintex. The above took a ton of trial and error, as well as multiple articles to get my scenario right. 

Feel free to provide more details if this does not work.

0 Kudos
Reply
ajcrow
Scholar

Re: Repeating section data into SharePoint List column

I realize after posting my lengthy response, I didn't address adding this info back into the list.
For this, you can set up a conditional statement inside the loop after the Query XML part but before the Math (add +1) function.

1. Add a Set a Condition module inside the loop,

  • The condition, "Any value equals value" 'Workflow data:Counter' is "Greater than or equal to" 'Value 2'.

2. For the "Yes" part of this condition,

  • Insert a create item. Set it to create a new item in your list and have it populate the fields required. These fields should be your SharePoint list columns. Make sure you assign them to the text output from the XML. (For new item ID, create a new variable to house this data).

3. For the "No" part,

  • Use a update item action. Set it to update the fields you want and use the data inside your XML text output to set them.

 

 

0 Kudos
Reply
JaredA
Scholar

Re: Repeating section data into SharePoint List column

Hey @ajcrow 

 

Thanks for the very detailed explenation!
Im still having some problems with your solution.

 

For the Query XML action:

-When you say "Change the XML source to XML", there are only 2 options in Nintex workflow which are "Existing SharePoint content" and "Content". Which one of these should i click on?

 

-Do i need to return the results as "Text", "Inner XML", or "Outer XML"?

 

For the collection operation:
-The only collection operation that seems logical to use would be the "Add item to collection" operation, is that correct? 

-In the "Add item to collection" operation i don't have anywhere where i can select count, which is why i think that i might not be using the right operation or we might be using different versions/platforms. Not sure about this.

 

For the Math operation:
Just like the collection operation, i can't seem to find this operation within Nintex Workflow.

Maybe it's just going right over my head but what should this function be called in the list of actions?

 

At this point i can't really test if this solution will work for me because of the missing operations.
Please let me know if i am doing anything wrong or i am just missing simple things.

 

Regards,

 

Jared

 

 

 

0 Kudos
Reply
ajcrow
Scholar

Re: Repeating section data into SharePoint List column

Hey Jared,

 

I will try to answer your questions as best I can!

 

-Query XML Action

  • I would say existing SharePoint content, and reference your SharePoint column with the XML.
  • The goal is to connect your XML "source" to the repeating section on your SharePoint list, as the form will be saving this information into the MLT (multi line text) field on your SharePoint list.
  • We want to provide the information from this SharePoint column as it contains the information we need.
  • Return your results as text when using the path I provided above.

-Collection Operation

  • You should have an operation called, "Count Items in a Collection".

-Math Operation

  • Use the operation called, "Do Calculation". The same logic should still apply here. we want to add +1 to the "Counter" variable so we don't end up looping through the same data endlessly.

 

Hopefully these operations are available to you. If they aren't, I would double check your Nintex config and make sure these actions are available.

https://help.nintex.com/en-US/office365/Settings/ActionAvailability.htm

 

-AJ

0 Kudos
Reply
ajcrow
Scholar

Re: Repeating section data into SharePoint List column

@JaredA Did you ever get this working?

0 Kudos
Reply