Alteryx Designer Desktop Discussions

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

Macro Input Problems for PDF Input Tool (Gallery) for looping through files

Bobbins
8 - Asteroid

Good Morning,

I am using the excellant PDF Input Tool found in the gallery and it works great for what i need to do (Intelligence suite can't handle tables, that's another post!) but i have come across a problem.

If I have multiple PDFs in the folder, it will try to bring them all in, handily giving me a "filename" that i should be able to use to batch through them.

However, I can't make the PDF Input Tool a macro input, (it is itself a macro), nor can I use a select or other tool.

The idea, originally before this problem, was to pull into the PDFs, create a list of filenames using the unique tool, and then use this tool to batch macro through them changing a filter (which matches the file name supplied by the unique tool).

However, if its only a text input that can be used, I am going to struggle. Any ideas?

Thank you

9 REPLIES 9
TheOC
15 - Aurora
15 - Aurora

Hi @Bobbins 

Sorry to hear about your issue!

If im not misunderstanding, you want to be able to batch through each PDF. You are correct that you cant use a PDF input tool as a macro input, however you can indeed pipe it into a macro you have already created:

TheOC_1-1647264043158.png


(error message under Image input due to not installing Intelligence Suite tools yet).

You could then have the batch macro loop through each PDF that is brought in by the tool, by creating the batch macro with the macro input tool. 
Despite being the text input that is converted - it doesn't just have to be text data that can be input into a batch macro. You can insert fields with report data, image data, spatial data, it all works. I do understand the confusion here however.

 

Additionally, you could have the control parameter change the file path in the image input tool: 

TheOC_2-1647264204367.png



More on that in the comments here:
https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Batch-macro-to-parse-pdf-files/td-p/48...


Hope this helps,
TheOC

 

Cheers,
TheOC
Connect with me:
LinkedIn Bulien
Bobbins
8 - Asteroid

Hello @TheOC 

I am unable to use the intelligence suite due to the problems above (it cant handle PDFs containing tables well) so I am having to use the above mentioned tool which does work well.

I have attached a dummy flow which kind of does what i want but not completely. I can put a "batch number" against each file, and then filter by that batch number with the idea being, it is then changed for the next and so on. In my real data, I have to strip out the header and apply some other tools to it, but the first tool is the record one. The other parts get dealt with in the data.

As you can see from the output, it outputs 1 file. If the batch macro was working correctly, I should see two and the files be separate.

Any ideas why this doesn't work?

TheOC
15 - Aurora
15 - Aurora

hey @Bobbins 

Apologies, i get an error when trying to use the PDF tools due to an R based issue. I believe this is just on my side.

In order to still have a look at your workflow, please could you create a fresh workflow with just the PDF tool (pointed at the two pdf files), and an output tool to a yxdb. Could you then attach that file to a comment, so i can replace the PDF tool in the workflow with that extract. This should work the same when it comes to running the workflow, if im not mistaken.

Cheers,
TheOC

Cheers,
TheOC
Connect with me:
LinkedIn Bulien
Bobbins
8 - Asteroid

Hi @TheOC 

Yep not a problem, yes some R configuration is required for higher versions, I need to sort that out myself!

I have put the Output of the PDFs into a text field and placed that instead of the PDF tool, I think that should work okay!

Regards


TheOC
15 - Aurora
15 - Aurora

hey @Bobbins 

I think i've achieved what you need:

TheOC_0-1647274718807.png



This is your workflow, created into a batch macro, allowing for a loop and output of each pdf.

I may have misunderstood the task, so do let me know if so.

Within the macro, you should see in the configuration, a way to specify the output location of your CSV files:

TheOC_1-1647274794746.png



you can also right click and open the macro, if you need to adjust it:

TheOC_2-1647274816197.png



Hope this helps!
TheOC

 

Cheers,
TheOC
Connect with me:
LinkedIn Bulien
Bobbins
8 - Asteroid

@TheOC Sorry could you post in a lower edition? Currently stuck on Version: 2020.4.5.12471

TheOC
15 - Aurora
15 - Aurora

hey @Bobbins 

Can you try this one?

Cheers,
TheOC

Cheers,
TheOC
Connect with me:
LinkedIn Bulien
Bobbins
8 - Asteroid

Hi @TheOC  I can confirm that works, thank you kindly. Question though, why doesn't the original batch work where you change the filter? I am guessing I am missing something fundamental, just not sure what but would be?

Thanks

TheOC
15 - Aurora
15 - Aurora

Hey @Bobbins 

The original wasn't being run as a batch - it was being run as a single workflow.

You need to save a batch, and import it onto a new workflow, for it to run as a batch.

 

Hope this helps,
TheOC

Cheers,
TheOC
Connect with me:
LinkedIn Bulien
Labels
Top Solution Authors