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">&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;</_b31ac585fd70cf00c1eff39ad3905793></Item><Item><_f73f2475040a12c37c8290bd379c3c8e type="System.String">Floor</_f73f2475040a12c37c8290bd379c3c8e><_b31ac585fd70cf00c1eff39ad3905793 type="System.String">&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;22&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;&lt;/_c9768d923e1f55aa7fa3d8b53835d517&gt;&lt;/Item&gt;&lt;Item&gt;&lt;_8064fc331cc3b0aae7cb3deba6393f32 type=&quot;System.String&quot;&gt;6&lt;/_8064fc331cc3b0aae7cb3deba6393f32&gt;&lt;_a84060f1aa2af1d24cd2d2e76ed58b22 type=&quot;System.String&quot;&gt;8:30 AM&lt;/_a84060f1aa2af1d24cd2d2e76ed58b22&gt;&lt;_d5c78cd3277bf4764b681f843c53de1b type=&quot;System.String&quot;&gt;9:00 AM&lt;/_d5c78cd3277bf4764b681f843c53de1b&gt;&lt;_c9768d923e1f55aa7fa3d8b53835d517 type=&quot;System.String&quot;&gt;&lt;/_c9768d923e1f55aa7fa3d8b53835d517&gt;&lt;/Item&gt;&lt;/Items&gt;&lt;/RepeaterData&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.
<?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>
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 "&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...
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?
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.
What can I do?