Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Loop workflow for multiple xml files

panupeltola
5 - Atom

Dear Alteryx Community,

 

I have a requirement to parse and combine approx. 250 xml files. For this purpose  I am using XML input/parse tool that is downloaded from Alteryx Gallery (link below). Rest of the workflow uses basic tools like select, formula, text2columns etc. (see picture attached)

 

Link to XML parse tool that im using:

https://gallery.alteryx.com/#!app/XML-Parse/5c1ef7bb0462d70ba8a4b755

 

All xml files have the same structure (identical column names) and they are located in the same folder.

 

Question is:

 

Instead of manually copy-pasting workflows for 250 files, is there a way to loop transformation workflow (transform data from xml to spreadsheet format) for all files?

 

Thank you for your reply in advance!

 

11 REPLIES 11
JoeS
Alteryx
Alteryx

Hi @panupeltola 

 

You'll want to create a batch macro to loop through each file.

 

If you upload a few sample XML files and your workflow. I'll be able to convert it or feel free to look at some of the great articles on here around batch macros.

panupeltola
5 - Atom

Hi JoeS,

 

Please find attached example workflow and example xml's. Let me know if you need any more details. Thank you so much!

JoeS
Alteryx
Alteryx

Hi @panupeltola 

 

No problem at all.

 

Please find attached the example workflow with the batch macro too.

 

2019-10-18_13-53-06.png

 

panupeltola
5 - Atom
Thanks JoeS, works like a charm and saved me a lot of time!

Wish you all the best 👍
JoeS
Alteryx
Alteryx

@panupeltola wrote:
Thanks JoeS, works like a charm and saved me a lot of time!

Wish you all the best 👍

Glad that's all working for you. And yep, definitely a lot nicer that doing it manually!

Erike
7 - Meteor

Cool, great work!

NeilFisk
9 - Comet

If the structure of all the XML files is the same, you can put them all in one folder and use a wildcard on the input tool that selects *.XML.  The challenge is the fields need to be identical in each file or they will be skipped when using the input in this fashion.

davidhenington
10 - Fireball

@DiganP Hi there i'm interested in reviewing the XML tool that is referenced in this thread, but it appears unavailable from the download site that's listed. Can you assist? 

 

Best - 

David

FabioP
8 - Asteroid

Could you guys help me?

What should I do here? I don't have this Engine.py (Python File).

 

 

FabioP_0-1666876004366.png

 

Labels