Skip to main content
Nintex Community Menu Bar

Hello,

 

This is driving me completely up the wall. 

 

I have a form on O365 (because the user will need the ability to edit the form after it is submitted; if I could use the NWC form builder this would not be an issue) with several nested repeating sections.  I'm on day three of figuring out how to get this RepeaterData xml processed on NWC.

 

Here's the whole xml dump:

 

 

<?xml version="1.0" encoding="utf-8"?><RepeaterData><Version>1.0</Version><Items><Item><_f73f2475040a12c37c8290bd379c3c8e type="System.String">Buffet</_f73f2475040a12c37c8290bd379c3c8e><_b31ac585fd70cf00c1eff39ad3905793 type="System.String">&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&amp;lt;RepeaterData&amp;gt;&amp;lt;Version&amp;gt;&amp;lt;/Version&amp;gt;&amp;lt;Items&amp;gt;&amp;lt;Item&amp;gt;&amp;lt;_8064fc331cc3b0aae7cb3deba6393f32 type=&amp;quot;System.String&amp;quot;&amp;gt;31&amp;lt;/_8064fc331cc3b0aae7cb3deba6393f32&amp;gt;&amp;lt;_a84060f1aa2af1d24cd2d2e76ed58b22 type=&amp;quot;System.String&amp;quot;&amp;gt;6:00 AM&amp;lt;/_a84060f1aa2af1d24cd2d2e76ed58b22&amp;gt;&amp;lt;_d5c78cd3277bf4764b681f843c53de1b type=&amp;quot;System.String&amp;quot;&amp;gt;Close&amp;lt;/_d5c78cd3277bf4764b681f843c53de1b&amp;gt;&amp;lt;_c9768d923e1f55aa7fa3d8b53835d517 type=&amp;quot;System.String&amp;quot;&amp;gt;test notes&amp;lt;/_c9768d923e1f55aa7fa3d8b53835d517&amp;gt;&amp;lt;/Item&amp;gt;&amp;lt;Item&amp;gt;&amp;lt;_8064fc331cc3b0aae7cb3deba6393f32 type=&amp;quot;System.String&amp;quot;&amp;gt;5&amp;lt;/_8064fc331cc3b0aae7cb3deba6393f32&amp;gt;&amp;lt;_a84060f1aa2af1d24cd2d2e76ed58b22 type=&amp;quot;System.String&amp;quot;&amp;gt;6:00 AM&amp;lt;/_a84060f1aa2af1d24cd2d2e76ed58b22&amp;gt;&amp;lt;_d5c78cd3277bf4764b681f843c53de1b type=&amp;quot;System.String&amp;quot;&amp;gt;Close&amp;lt;/_d5c78cd3277bf4764b681f843c53de1b&amp;gt;&amp;lt;_c9768d923e1f55aa7fa3d8b53835d517 type=&amp;quot;System.String&amp;quot;&amp;gt;test notes 2&amp;lt;/_c9768d923e1f55aa7fa3d8b53835d517&amp;gt;&amp;lt;/Item&amp;gt;&amp;lt;Item&amp;gt;&amp;lt;_8064fc331cc3b0aae7cb3deba6393f32 type=&amp;quot;System.String&amp;quot;&amp;gt;7&amp;lt;/_8064fc331cc3b0aae7cb3deba6393f32&amp;gt;&amp;lt;_a84060f1aa2af1d24cd2d2e76ed58b22 type=&amp;quot;System.String&amp;quot;&amp;gt;6:00 AM&amp;lt;/_a84060f1aa2af1d24cd2d2e76ed58b22&amp;gt;&amp;lt;_d5c78cd3277bf4764b681f843c53de1b type=&amp;quot;System.String&amp;quot;&amp;gt;6:30 AM&amp;lt;/_d5c78cd3277bf4764b681f843c53de1b&amp;gt;&amp;lt;_c9768d923e1f55aa7fa3d8b53835d517 type=&amp;quot;System.String&amp;quot;&amp;gt;&amp;lt;/_c9768d923e1f55aa7fa3d8b53835d517&amp;gt;&amp;lt;/Item&amp;gt;&amp;lt;/Items&amp;gt;&amp;lt;/RepeaterData&amp;gt;</_b31ac585fd70cf00c1eff39ad3905793></Item><Item><_f73f2475040a12c37c8290bd379c3c8e type="System.String">Floor</_f73f2475040a12c37c8290bd379c3c8e><_b31ac585fd70cf00c1eff39ad3905793 type="System.String">&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&amp;lt;RepeaterData&amp;gt;&amp;lt;Version&amp;gt;&amp;lt;/Version&amp;gt;&amp;lt;Items&amp;gt;&amp;lt;Item&amp;gt;&amp;lt;_8064fc331cc3b0aae7cb3deba6393f32 type=&amp;quot;System.String&amp;quot;&amp;gt;22&amp;lt;/_8064fc331cc3b0aae7cb3deba6393f32&amp;gt;&amp;lt;_a84060f1aa2af1d24cd2d2e76ed58b22 type=&amp;quot;System.String&amp;quot;&amp;gt;6:00 AM&amp;lt;/_a84060f1aa2af1d24cd2d2e76ed58b22&amp;gt;&amp;lt;_d5c78cd3277bf4764b681f843c53de1b type=&amp;quot;System.String&amp;quot;&amp;gt;Close&amp;lt;/_d5c78cd3277bf4764b681f843c53de1b&amp;gt;&amp;lt;_c9768d923e1f55aa7fa3d8b53835d517 type=&amp;quot;System.String&amp;quot;&amp;gt;&amp;lt;/_c9768d923e1f55aa7fa3d8b53835d517&amp;gt;&amp;lt;/Item&amp;gt;&amp;lt;Item&amp;gt;&amp;lt;_8064fc331cc3b0aae7cb3deba6393f32 type=&amp;quot;System.String&amp;quot;&amp;gt;6&amp;lt;/_8064fc331cc3b0aae7cb3deba6393f32&amp;gt;&amp;lt;_a84060f1aa2af1d24cd2d2e76ed58b22 type=&amp;quot;System.String&amp;quot;&amp;gt;8:30 AM&amp;lt;/_a84060f1aa2af1d24cd2d2e76ed58b22&amp;gt;&amp;lt;_d5c78cd3277bf4764b681f843c53de1b type=&amp;quot;System.String&amp;quot;&amp;gt;9:00 AM&amp;lt;/_d5c78cd3277bf4764b681f843c53de1b&amp;gt;&amp;lt;_c9768d923e1f55aa7fa3d8b53835d517 type=&amp;quot;System.String&amp;quot;&amp;gt;&amp;lt;/_c9768d923e1f55aa7fa3d8b53835d517&amp;gt;&amp;lt;/Item&amp;gt;&amp;lt;/Items&amp;gt;&amp;lt;/RepeaterData&amp;gt;</_b31ac585fd70cf00c1eff39ad3905793></Item></Items></RepeaterData>

 

 

 

The goal is to process the repeating section for each role seperately, so first I query xml to get the title of each role.  Then for each item returned, Query XML for the respective repeating section, so Loop for Each > Calculate Value "Index +1", Query XML //Item "Index+1"]/_b31ac585fd70cf00c1eff39ad3905793

 

If I choose "Inner XML" to grab the repeating sections, it comes out encoded, so the next Query XML action fails.

 

 

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;RepeaterData&gt;&lt;Version&gt;&lt;/Version&gt;&lt;Items&gt;&lt;Item&gt;&lt;_8064fc331cc3b0aae7cb3deba6393f32 type=&quot;System.String&quot;&gt;31&lt;/_8064fc331cc3b0aae7cb3deba6393f32&gt;&lt;_a84060f1aa2af1d24cd2d2e76ed58b22 type=&quot;System.String&quot;&gt;6:00 AM&lt;/_a84060f1aa2af1d24cd2d2e76ed58b22&gt;&lt;_d5c78cd3277bf4764b681f843c53de1b type=&quot;System.String&quot;&gt;Close&lt;/_d5c78cd3277bf4764b681f843c53de1b&gt;&lt;_c9768d923e1f55aa7fa3d8b53835d517 type=&quot;System.String&quot;&gt;test notes&lt;/_c9768d923e1f55aa7fa3d8b53835d517&gt;&lt;/Item&gt;&lt;Item&gt;&lt;_8064fc331cc3b0aae7cb3deba6393f32 type=&quot;System.String&quot;&gt;5&lt;/_8064fc331cc3b0aae7cb3deba6393f32&gt;&lt;_a84060f1aa2af1d24cd2d2e76ed58b22 type=&quot;System.String&quot;&gt;6:00 AM&lt;/_a84060f1aa2af1d24cd2d2e76ed58b22&gt;&lt;_d5c78cd3277bf4764b681f843c53de1b type=&quot;System.String&quot;&gt;Close&lt;/_d5c78cd3277bf4764b681f843c53de1b&gt;&lt;_c9768d923e1f55aa7fa3d8b53835d517 type=&quot;System.String&quot;&gt;test notes 2&lt;/_c9768d923e1f55aa7fa3d8b53835d517&gt;&lt;/Item&gt;&lt;Item&gt;&lt;_8064fc331cc3b0aae7cb3deba6393f32 type=&quot;System.String&quot;&gt;7&lt;/_8064fc331cc3b0aae7cb3deba6393f32&gt;&lt;_a84060f1aa2af1d24cd2d2e76ed58b22 type=&quot;System.String&quot;&gt;6:00 AM&lt;/_a84060f1aa2af1d24cd2d2e76ed58b22&gt;&lt;_d5c78cd3277bf4764b681f843c53de1b type=&quot;System.String&quot;&gt;6:30 AM&lt;/_d5c78cd3277bf4764b681f843c53de1b&gt;&lt;_c9768d923e1f55aa7fa3d8b53835d517 type=&quot;System.String&quot;&gt;&lt;/_c9768d923e1f55aa7fa3d8b53835d517&gt;&lt;/Item&gt;&lt;/Items&gt;&lt;/RepeaterData&gt;

 

 

 

Now, that is expected, and should be fine, except that I cannot figure out a way to decode it inside of NWC-- Inline fuctions are not available for fn-XmlDecode, and regular expression doesnt work, because if I try to put, say "&amp;lt;" into the pattern field, the NWC action converts it to < automatically.

 

If I choose to return it as text instead, it comes out

 

 

<?xml version="1.0" encoding="utf-8"?><RepeaterData><Version></Version><Items><Item><_8064fc331cc3b0aae7cb3deba6393f32 type="System.String">31</_8064fc331cc3b0aae7cb3deba6393f32><_a84060f1aa2af1d24cd2d2e76ed58b22 type="System.String">6:00 AM</_a84060f1aa2af1d24cd2d2e76ed58b22><_d5c78cd3277bf4764b681f843c53de1b type="System.String">Close</_d5c78cd3277bf4764b681f843c53de1b><_c9768d923e1f55aa7fa3d8b53835d517 type="System.String">test notes</_c9768d923e1f55aa7fa3d8b53835d517></Item><Item><_8064fc331cc3b0aae7cb3deba6393f32 type="System.String">5</_8064fc331cc3b0aae7cb3deba6393f32><_a84060f1aa2af1d24cd2d2e76ed58b22 type="System.String">6:00 AM</_a84060f1aa2af1d24cd2d2e76ed58b22><_d5c78cd3277bf4764b681f843c53de1b type="System.String">Close</_d5c78cd3277bf4764b681f843c53de1b><_c9768d923e1f55aa7fa3d8b53835d517 type="System.String">test notes 2</_c9768d923e1f55aa7fa3d8b53835d517></Item><Item><_8064fc331cc3b0aae7cb3deba6393f32 type="System.String">7</_8064fc331cc3b0aae7cb3deba6393f32><_a84060f1aa2af1d24cd2d2e76ed58b22 type="System.String">6:00 AM</_a84060f1aa2af1d24cd2d2e76ed58b22><_d5c78cd3277bf4764b681f843c53de1b type="System.String">6:30 AM</_d5c78cd3277bf4764b681f843c53de1b><_c9768d923e1f55aa7fa3d8b53835d517 type="System.String"></_c9768d923e1f55aa7fa3d8b53835d517></Item></Items></RepeaterData>

 

 

 

This looks promising-- decoded XML, cool.  But the next Query XML action still fails:

 

 

XML Source Value is Invalid: Data at the root level is invalid. Line 1, position 1.. lError Code: Xml.InvalidXmlSource]

 

 

 

Now here is where it gets crazy.  If I copy the exact text from the last "log to instance details" into a "set variable value" action and use Query XML on that, it succeeds...

 

24312i7EC9A72500E8C24B.jpg

24314iA14785B1FB078D14.jpg

 

These employee IDs are exactly what I need to get out of this part of my workflow!

 

Great, so I will just run the variable through a "set variable value" action, that should have the same effect, right?

 

24315i0C75EFE68F66FCFF.jpg

 

No! It does not!  It doesn't do the same thing, even though it is perceptibly the same input through the same action with two different results.

 

24317i17567C8910B1ED4D.jpg

 

What can I do?

Hi @chuckwould 



 



Understanding your requirements took some amount of effort! 



It really helps to clean up the XML and beautifying the format.



 



Summary



Data: SharePoint Online (SPO)
Form: Nintex O365 Form
Workflow: NWC



 



XML (After Clean Up) (Image)





 



XML Interpretation (based on your explanation and your data)





 



Are you trying to extracting the Staff ID?



Using PowerShell, I am able to extract the following 





 



So what is your goal?



Could you clarify what do you want to achieve/do/perform?


Yes, exactly what you did with Powershell, but within the NWC workflow.  That is the information I need to process.  I just can't figure out how to get NWC to decode the XML in a way that's usable by the Query XML action.



 



Powershell is really great!  Wish I could use it for this...


After the 1st query. return it as TEXT (the nice XML output) - save to a variable.



Update the SP List (use a multi line column, create a new column if needed). Visually verify that the new column contains the XML. 



 



Then try XML Query using that column as the source. 



 



 



 




Same result.  Invalid XML


I'm actually giving up on this, as the NWC actions seem to modify my strings in ways that I can't seem to understand or circumvent.  I assume this behavior is the result of measures in place to prevent cross site scripting, or perhaps they're just not intended to be used this way; in any case, I'm just going to approach this process in a different way.


Hi @chuckwould ,



Actually I faced this issue with PowerShell. If there is a problem its with source nested XML.



My workaround is to save to a text file and then reload as XML.



That's why I suggested you to save it into a SP column.



 



If you can code Web Services, you could create your own functions for this.



 



For my solution, I would use 



- NWC SendMail - Notify when there is XML to convert



- Run PowerShell for the XML processing. Update Status is Done



- NWC - Wait for event in list item Status is Done



- NWC Continue with Workflow



 


@chuckwould 



One final suggestion - De-Normalize the Data



 



What I meant is avoid using the Nested Repeating Section. Instead use a single-level Repeating Section (Since you have no issue with a single layer of the XML).



------



Role | Staff ID | Start Time | End Time | Comments



Role | Staff ID | Start Time | End Time | Comments



-----


This is what I ended up doing, and the next item just inherets its role as a default value from the item before. I don't like this as much as what I had originally from a ux perspective, but hey, at least it works



 



e: also, I wanted to say thanks for your time in helping with this


Hey @chuckwould 



Glad to hear that you manage to find a workaround. I also learn something out of this.



Seems to be a Win-win for both of us.



 


Reply