How do I pass in a value in a workflow one at a time using macro?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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 value
Solved! Go to Solution.
- Labels:
- Macros
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you so much for your assistance.
