Page 1 of 1

Filter files based on content within XML file?

Posted: Tue Oct 17, 2023 4:43 pm
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.

Re: Filter files based on content within XML file?

Posted: Tue Oct 17, 2023 5:16 pm
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.

Re: Filter files based on content within XML file?

Posted: Wed Oct 18, 2023 11:11 am
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?