Filter files based on content within XML file?

Post Reply
alr
Newbie
Posts: 2
Joined: Wed Aug 04, 2021 11:45 am

Filter files based on content within XML file?

Post by alr »

I've got a number of XML files coming into a workflow and I need to filter them based on some content in the file itself. I can't filter based on the filename as it's random.

Extract of the XML:

Code: Select all

<attributes>
   <attribute group="Graph" kind="string" name="ProductName">Product1</attribute>
</attributes>
I need to be able to filter on the ProductName, either Product1 or Product2, with them each going into different folders.

Do I use the XML pickup tool here? If so I'm not sure how to go about it using it.
jan_suhr
Advanced member
Posts: 592
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Filter files based on content within XML file?

Post by jan_suhr »

Yes you need to use the XML-pickup tool, set it to "Metadata is asset" and the XML content will become a dataset. And then you can use the values in the dataset to sort your files.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
alr
Newbie
Posts: 2
Joined: Wed Aug 04, 2021 11:45 am

Re: Filter files based on content within XML file?

Post by alr »

How can I query this dataset in Switch? Do I have to use a script expression, or can I for example use the "Condition with variables defined" when connecting between two folders?
Post Reply