Alteryx Designer Desktop Discussions

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

Batch processing Italian XML e-invoices

ck2019
9 - Comet

Hello everyone

 

I've figured out what my final XML Parsing should look like, which has taken a while, but I am happy with the results.

 

I need to extract multiple XML invoices.  They'd actually be contained in a zip file so ideally i'd be able to extract and process but worst case we could just manually extract.

 

What I'd like to do is have all xml go into this one file that would be generated each day for the batch of invoices that are received through our e-invoicing portal

2019-11-06_11-10-43.jpg

I've seen another similar request where JoeS helped create a batch macro to do this (without the zip element) so hoping that some kind individual (maybe JoeS) can help point me in the right direction!

 

Thanks a lot

Cass

 

 

9 REPLIES 9
JoeS
Alteryx
Alteryx

Hi @ck2019 

 

I have created a batch macro of your original workflow.

 

I think one of the sample XMLs that you sent through were missing a few elements though, so I haven't been able to test it my side.

 

Please find the batch macro attached. It will need the receive a list of full paths.

 

Macro.png

 

ck2019
9 - Comet

Hi Joe

 

Thanks for jumping on board

I uploaded the wrong version as I subsequently discovered the Ensure Fields to deal with those instances of child fields not being present in the XML.

 

I have updated it in the attached, but the problem I find is that it is just repeating contents of the first file rather than importing both files.

 

If I run the workflow for the two invoices in the package individually I'd expect 4 lines.

 

Output 1.jpg

output 2.jpg

 

But the batch report produces this

 

output 3.jpg

 

Could you help me get this right?  I just tried adding a 3rd xml and it just creates additional lines of the first xml.

 

Thanks for your help.  This will the AP team a good chunk of time so really keen to get it working!

JoeS
Alteryx
Alteryx

Hi @ck2019 

 

It looks like the action tools weren't quite configured.

Macro1.png

If you look on the left hand side above nothing has been selected to be updated. I changed this in the below:

Macro2.png

This now updated the input path to the new XML file location.

It also was the same for your action to update the formula tool, so I updated that too:

Macro3.png

You can see at the top I needed to update the expression, but also down the bottom I needed to just replace the ReplaceMe, not the strings otherwise the expression will have a syntax error as the file path will not be text qualified.

 

Lastly I then tested it to find out the schema's are slightly different for each file. So I needed to update this setting in the interface view:

Macro4.png

 

Which then lead to me getting the output you require (I hope!)

 

Macro5.png

 

Please find the macro attached. 

 

PS, I used to work for Experian for 10 years 🙂

ck2019
9 - Comet

Hi  Joe

 

You are a legend.

 

Thanks for that clarification - clearly missed a few key steps!  What am I missing with the macro config as on the interface designed for me it doesn't have anything! Could you share the workflow instead of the macro - that'd probably solve it but it'd be good to know for next time anyway!  

 

I've heard about a few people that have left Experian to pursue Alteryx careers elsewhere - it is a strong draw!

 

Thanks again.

 

macro config.jpg

JoeS
Alteryx
Alteryx

Hi @ck2019 

 

No problem. You'll need to be in the macro itself for that tab to work, rather than on it within a workflow.

 

If that makes sense? AKA open the macro in Designer.

 

Cheers

 

Joe

ck2019
9 - Comet

Makes a lot of sense - I think I was just confused with one of the pics!

 

I am not sure what I am doing wrong, but I get this error when I try and run the macro...can you upload the version of the workflow that contains the macro inserted within it and i'll see ifi can get it to work?

 

macro error.jpg

 

Thanks

Cass

JoeS
Alteryx
Alteryx

Hi Cass,

 

No problem. Please find it attached.

 

Thanks

Joe

ck2019
9 - Comet

Awesome, thanks a lot Joe.

 

I need to create some room on my hard drive though as it consumes a huge amount of temporary space so I'm not quite there yet, but I will get there shortly!  Thanks for your help, really appreciate it.

JoeS
Alteryx
Alteryx

Yeah, it can start to create a few temp files when powering through it all!

 

You're welcome glad we got there and it's going to save you some time going forwards.

Labels