My question is about how to get at the data you caputure in a repeating section in NWC.
I know this is a new control, so there may be no answers yet, however in O365 you write the data from a repeating section control to a Multi-lines of text field then parse the XML with with a 'Query XML' action to pull that apart. However, in NWC the repeating section seems to store the data as a Collection/array, not as XML. So, I would have thought you could use Collection operations on that. Not so it would seem: I can use 'Count items in collection' to get the number of sections, but I have tried and failed to use 'Get item from collection' to get values. Not that I can see how that would work anyway - what type of variable do you use to store different data types (say, text and a number) from a section?
In case I'm missing something here I'd love to hear from someone to let me know. As it is, I can't see what use repeating sections in NWC have if I can't do anything with the data captured.
Solved! Go to Solution.
An update for anyone interested.
Through testing I've found you can use the 'Apply a regular expression' WF action to get at data in a section. This is a bit cumbersome however: you need to count the items in the Collection and then for each section run multiple RexEx actions to get each variable/field from each section.
Again, I would be happy to hear from anyone else if I'm missing something here and there's a better or easier way to get at the data.
I'm using a repeating section in a workflow and I'd like to write the data to a SharePoint Online list. Any ideas how to do this with the data from the repeating section(s)? In this case my section can be repeated up to six times. Since there can be anywhere from one to six sections, how could the data from these sections be obtained and written over to columns in SPO?
As I said above, the only way I've found you can get the data out of a repeating section in NWC for now is to treat the Repeating Section like a Collection and then use a 'Apply a regular express' WF action to extract the data for individual fields in a section. It's clunky, and I expect Nintex will build better functionality to handle repeating sections eventually but as far as I can see this is the only way to do it now.
So for example, in your form you have the Repeating section, then in your WF you add a 'Loop for each' action with the target Collection being the Repeating section control. Inside the loop you have an 'Apply a regular expression' action. For that action the Input text will be the 'Loop for each > Object > Current item' with an 'Extract' Operation, to pull out the data for a field.
Before you can construct the regular expression you will need to know what the structure of the data in that Collection item (really, a section) looks like. To get this you will need to run the WF once either with a 'Log to instance details' or 'Send an email' action in the loop to send you an example of what the data in that section looks like - structure, field codes, etc. for everything in the sample section. With that in hand you can then build your regular expression to extract a field of data from the Collection item (section). Add additional 'Apply a regular expression' actions in the loop to extract the values for each field in a section.
Take a look online to see how to construct the 'Extract' regular expression. I found there are some good tester tools out there too that let you test your expression on your sample data - unfortunately I forgot to bookmark them.
Now you should have the values for each field in a section in separate variables in your loop. Add a SharePoint 'Create an item' action to write those values to a list and your done. The loop will perform the same set of actions for each section in your Repeating section control.
Use a loop for each action in your workflow and use the repeating section control on your start form as the target collection.
Inside your loop for each, you can assign the values of the individual controls contained in the repeating section to variables or reference them in other workflow actions. Example:
More information about the loop for each action can be found here: https://help.nintex.com/en-US/nwc/Content/Designer/Actions/LoopforEach.htm
How does this work if you are using NWC to look up data from a list created using an O365 form? The repeater data type is text, not collection. Would I use Query JSON instead?