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

Run command - How to use the dynamic name in command part coming from write source part ?

erambeau
7 - Meteor

Hi,

 

I wonder if it is possible to variabilize the name of the .bat file in a « run command » tool, in the « command » part ?

I saw I could append a suffix in the « write source » part.

How can I run the batch which also has a new name ?

 

NB : I am in an iterative macro, so that I can’t use control parameters of batch macros.

 

exemple.png

 

I can provide you more details about my need if necessary.

Thank you for your help.

 

Emmanuel

2 REPLIES 2
sumitiiest
8 - Asteroid

Hi @erambeau ,

 

You can put your run command tool in a batch macro, configure the run tool using the control parameter.

Now you can use the above batch macro in your iterative macro.

 

You can share the workflow if you think there are additional complexity associated with this one.

 

 

Thanks,

Sumit

erambeau
7 - Meteor

Hi,

Thank your for your answer.

I think I should explain the context, because with your solution, I would have a workflow calling a batch macro calling an iterative macro calling a batch macro.

It becomes a little bit complex and I wonder if I could do more simpler ?

 

----

 

Each day, I use .bat to generate PDF files. I have one .bat per file to generated.

Sometimes, when I execute a .bat, the generation of PDF does not work (for many reasons like connection errors but we don’t care) and file are not generated.

In this case, I just want to retry the generation (so execute again the batch).

 

----

What I did (it’s a little bit different as I said above) :

1) I have a batch macro, which generate a batch per file to generate (for instance : export_PDF_20190516_130916.bat). No execution of the batch here.

2) Inside of that batch macro, I put an iterative macro. It creates a batch file with an unique name (i.e : export_PDF.bat) which call the previous batch (export_PDF_20190516_130916.bat).

3) Thanks to a « Block Until Done » tool, I check with the formula FileExists if the PDF does exist, and I retry if necessary (with iterative output).

 

----

An unique call of the first batch macro works.

Nevertheless, I have concurrential executions, and the first batch macro can be called in multiple places at the same time.

Unfortunately, even if the iteration is successful, this process does not work in case of multiple generation of PDF, as the file export_PDF.bat is already used.

 

So, I was looking for a way to directly calling the .bat generated at the beginning.

 

What do you think ? How would you do ?

 

Emmanuel

Labels