cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Collection Operation Sort is adding semicolons between tags

Jump to solution

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  -      </mySmiley TonguerintItem_New>;<mySmiley TonguerintItem_New>

and at end of collection   -  </mySmiley TonguerintItem_New>;</mySmiley TonguerintItems_New>

These are causing the InfoPath form to error when trying to load.

Has anyone experienced this or know how to fix it?

Thanks!

0 Kudos
Reply
4 Replies
Workflow Hero

Re: Collection Operation Sort is adding semicolons between tags

Jump 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.

Reply
Workflow Hero

Re: Collection Operation Sort is adding semicolons between tags

Jump to solution

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!

0 Kudos
Reply
Workflow Hero

Re: Collection Operation Sort is adding semicolons between tags

Jump to solution

I'm sorry I do not have any magic link/documentation.

just official manuals http://help.nintex.com/en-US/nintex2013/help/#workflow/RootCategory/Actions/Nintex.Workflow.Collecti... 

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.

0 Kudos
Reply
Workflow Hero

Re: Collection Operation Sort is adding semicolons between tags

Jump to solution

0 Kudos
Reply