Page 1 of 1

Sort xml based on field content

Posted: Fri Apr 13, 2018 12:47 am
by neecerp
We are trying to sort xml based on the content of a quantity in a field.
We are trying to accomplish this only using folders to sort, with metadata "traveling" with the pdf.

One folder would sort <500 and another would be >500

It seems like the only option is to read xml in the beginning and use expressions.

We pass metadata with the pdf throughout different flows and would like to grab it that way.

Any ideas? I would think this should be easier than what I have found so far using Switch/calculations.

Re: Sort xml based on field content

Posted: Mon Apr 16, 2018 10:56 am
by Padawan
Personally, I would do it like this:

- Use xml pickup to store the XML files as dataset
- Have two outgoing connections
- One which only accepts jobs where you check if the number is lower then 500. (Make sure you use an Integer variable)
- One which accepts all other jobs

Something like this flow:
https://ufile.io/64aca

This sounds a lot like the flow you already have, but I don't know of a better way to do it. Would it also be possible to elaborate on why you don't like the current method?

Re: Sort xml based on field content

Posted: Mon Apr 16, 2018 4:50 pm
by neecerp
I ended up doing it similar to your sample. Thanks for your help.

Re: Sort xml based on field content

Posted: Wed Apr 18, 2018 3:32 pm
by neecerp
Are you aware of a way to sort just like your example, but have the flow read the xml that is ASSOCIATED with the pdf that is traveling through the flow? I am wondering why I have to read the xml before this will work.
It does not seem to work when I have multiple flows sending the same pdf through them, even though it reads the xml for that pdf in the beginning.
Seems like it should be simpler.

Re: Sort xml based on field content

Posted: Wed Apr 18, 2018 6:01 pm
by Padawan
If the XML is already a dataset of the PDF, then you don't need the XML pickup anymore. You will just have to adjust the variable in the "Higher then or equal to 500" connection so it points to the correct xml dataset associated with your job.