Inspire EMEA 2022 On-Demand is live! Watch now, and be sure to save the date for Inspire 2023 in Las Vegas next May.
We'll be completing standard maintenance for our Single Sign-On system on November 30th 6pm Pacific Time for approximately one hour. During this time My Alteryx and sign-in functionality to all My Alteryx programs (Licensing Portal, Community, Beta Program, Case Portal, and others) may be inaccessible. Thank you for your patience.

Alteryx Designer Discussions

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

How do I pass in a value in a workflow one at a time using macro?

hfanda73
8 - Asteroid

Hello All,

 

This is my first post. I have created a workflow that uses a static string as part of a URL that fetch data for me from that URL.

I have a list of 10 different URLs that I need to do the same thing on. Each process depends on this one string at the end of the URL.

How can I use macro to help me pass one value at a time from a list (say the list is inside an Excel file) into this workflow and cleverly save the output file with the same name as the string i passed in (i think i can do the latter)?

 

The value I want to pass in is sitting in the second text input as show in my workflow below.

 

Regards,

Henri Fanda

 

My current workflow that works with one valueMy current workflow that works with one value

9 REPLIES 9
KaneG
Alteryx Alumni (Retired)

A Batch Macro is what you are after here. There is a good example under 'Help > Sample Workflows > Macro Samples > Batch...' which shows passing files one at a time to a batch macro.

 

Your value in question will be your Control Parameter as that will define the number of different batches.

 

When you put the Control Parameter on the canvas 'Workflow Type' will automatically change to Batch Macro. There is also some configs under the Interface Designer Wrench. 

 

A note on the picture in your question though, you are creating the batch file and then using a Block Until Done... You could just create the batch file in the 'Write' section of the Run Command as below

 

2017-06-22_1620.png

 

That will take out the dependency where it needs to write first before being run, as the Run Command Tool will control it. The BUD Tool will wait until it has all the data before releasing it, not wait until all previous processes are complete. Likewise, if you have multiple outputs on the BUD, then the tool will wait until all the data has been released out the first output, before starting to release out the second output etc.

hfanda73
8 - Asteroid

Thanks for the quick response KaneG.

 

I did have a look at the example and it looks quite complicated. Are you referring to the "Individual Tool Count Batch Macro"? Maybe I was looking at the wrong one.

My current workflow works fine but only once. One of my input data is just a word, say "table1", "table2", "table3". I tried to create a simple macro that can read a list of values in Excel file and then pick the first value, say "table1" and pass it to the input text tool to fit into the workflow. And then read in the second value in the list and pass it on and so forth.

 

I have tried working on the macro, but just can't configure it to work. Can you show me a quick example KaneG?

 

Thanking you,

Henri

 

 

KaneG
Alteryx Alumni (Retired)

That is the example that I was talking about. 

 

I have attached an example of a batch macro like what is needed in your case, whereby more processing would just need to be done in the Macro (download etc...)

hfanda73
8 - Asteroid

Thanks so much KaneG. I will have to go now but I will try it out again first thing tomorrow morning Sydney time. I think it will work. I will let you know.

 

Regards,

Henri

hfanda73
8 - Asteroid

Hi Kane,

 

Firstly thanks so much for doing that sample for me. 

When I tried changing the input value from 'table1' to 'actions' and 'table2' to 'xyz', it keeps giving me error message.

Can you point me to the right direction and tell me where I could have gone wrong?

 

It fails when I changed the sample input data to my input data, eg. "table1" to "actions"It fails when I changed the sample input data to my input data, eg. "table1" to "actions"

hfanda73
8 - Asteroid

Hi KaneG,

 

I think i have solved it now. I need to go to my Interface Designer and choose the wrench tool and select the Output mode to "Auto Configure  by Name ..."

 

Thanks so much for your great sample. Really appreciate it.

 

Regards,

Henri

JayshriKolte
6 - Meteoroid

Hi Team,

I am new in Alteryx API and Workflow. Please guide me on below scenario:

 

For Alteryx Workflow: as input it is using csv file. the path of this csv is hardcoded .And I am executing this workflow through Alteryx API using AlteryxApi.AlteryxRunModule2. As per the requirement i have to pass the input file path runtime.

Please guide me how can I achieve it. 

KaneG
Alteryx Alumni (Retired)

Hi @JayshriKolte,

 

You're always better off creating a new post so that everyone sees it. Posting on this discussion, there's a chance only the people who've posted before on this thread see it.

 

The question you've asked looks to be regarding the engine API and so I'm guessing that you are building a tool using the SDK... That question will be much better placed on this forum.

JayshriKolte
6 - Meteoroid

Thank you so much for your assistance. 

Labels