I build a SharePoint form with dynamic rows (repeating sections in Nintex form) that have four fields in each row. Users could enter ', &, <, > in the first two text fields. The data of the dynamic rows are saved as XML.
Below is two rows of data:
<?xml version='1.0' encoding='utf-8'?><RepeaterData><Version /><Items><Item><Milestones type='System.String'>test1's & <name></Milestones><Descriptions type='System.String'>test1's name</Descriptions><Recipients type='System.String'>user1, user2</Recipients><DueDate type='System.DateTime'>11/1/2021</DueDate></Item><Item><Milestones type='System.String'>TEST 2 </Milestones><Descriptions type='System.String'>TEST 2 </Descriptions><Recipients type='System.String'>user1, user2</Recipients><DueDate type='System.DateTime'>10/27/2021</DueDate></Item></Items>
</RepeaterData>
I use a Compose action to escape &: REPLACE(outputs('getRepeatingActions'),'&','ZZZ'), then another compose to run xpath:
' doesn't seem to have problem with xpath, & I code it as ZZZ then convert it back with replace function when I use it to send email. The tricky part is with angle brackets,< and >. The workflow fails when the text field has < or >.
The error is: Unable to process template language expressions in action 'getAllItems' inputs at line '1' and column '14916': 'The template language function 'xml' parameter is not valid. The provided value cannot be converted to XML: 'The 'Name' start tag on line 1 position 168 does not match the end tag of 'Milestones'. Line 1, position 175.'. Please see https://aka.ms/logicexpressions#xml for usage details.'.
How to escape angle brackets to allow xpath to work? When there are angle brackets in XML, convert to JSON doesn't work either.
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2