Hi - In a Workflow I am getting a collection of Items, using a collection operation to sort them ascending, then writing that collection back into the XML document.
When I inspect the XML after, the collection is getting written to the correct spot, but the individual items now have a semi-colon after each ending tag
i.e. individual items - </my:PrintItem_New>;<my:PrintItem_New>
and at end of collection - </my:PrintItem_New>;</my:PrintItems_New>
These are causing the InfoPath form to error when trying to load.
Has anyone experienced this or know how to fix it?
Solved! Go to Solution.
can you post an example how do you put sorted collection back to XML?
if you put it back directly as collection variable, then that's the reason you see semicolons there.
you have to JOIN collection elements into a string first and then insert that string into XML.
Hi Marian - sounds like you hit it on the nose! I am trying to write the collection directly back to the XML (see image below).
Do you happen to have a reference (link?) to where you learned that info? I wasn't able to find much specifically about the collection operation task and sorting other than than the basic "user manual" info, and some other blogs about looping and looking at individual lines...
Also do you happen to have any links/samples on how to implement what you suggested? Sounds like I need to loop the rows, parse out the elements, build a string (for the whole row), then insert that row into the XML in the collection. How do I remove the original row in the XML?
Thanks for your help!
I'm sorry I do not have any magic link/documentation.
and a bit of experience.
making a string out collection elements is very simple
place one another collection action into workflow, select your source collection, choose join operation and some output variable (multiline text)
finally instead of collection insert that string into XML.