Sort xml based on field content

Post Reply
User avatar
neecerp
Member
Posts: 27
Joined: Tue Jun 05, 2012 9:21 pm

Sort xml based on field content

Post 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.
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: Sort xml based on field content

Post 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?
User avatar
neecerp
Member
Posts: 27
Joined: Tue Jun 05, 2012 9:21 pm

Re: Sort xml based on field content

Post by neecerp »

I ended up doing it similar to your sample. Thanks for your help.
User avatar
neecerp
Member
Posts: 27
Joined: Tue Jun 05, 2012 9:21 pm

Re: Sort xml based on field content

Post 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.
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: Sort xml based on field content

Post 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.
Post Reply