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 with Dynamic Parameters

cmbarnett
6 - Meteoroid

I'm trying to build a workflow that will run a command similar to the one I've specified below, except with 3 parameters that come from the Text Input tool. (Eventually I'd like to be able to run this command multiple times in a loop but where the parameters change)

 

Here's the command I'm able to run in the Windows Command Prompt (dmsrun is a separate software package we use):

dmsrun "U:\User\path\7300301_2 Edit DCG.dms" /d"WHERE \"SELECT Respondent.Serial, Respondent.ID FROM VDATA\"" > "U:\User\path\Output.txt"

 

I cannot seem to configure the Run Command to do this. Any suggestions or ideas?

5 REPLIES 5
MichalM
Alteryx
Alteryx

@cmbarnett 

 

Have you built a batch macro before?

This would allow you to pass a list of parameter into the run command tool and execute the command for each of these until you reach the end of the list. See the below.

 

When saved this will turn into a standalone "tool" which will be able to accept the list of values through the Control (Dynamic) parameter - think of these as a trap door through which you can drip-feed the parameters into another workflow.

 

batch-macro.png

 

darryl5280
10 - Fireball

Try your “dmsrun” on the “Command Prompt” Window, to see if there are any syntax errors.

 

But DOS might not know about the “dmsrun” program like it doesn’t know “7z” so I have put it’s path name in front of it.

 

c:\Program Files\7-Zip\7z

cmbarnett
6 - Meteoroid
The command runs in the command prompt no problem. But executing the same command using the Run Command tool is what I'm after.
darryl5280
10 - Fireball

It must be a problem in the Configuration Window for the "Run Command" Tool, as it is tricky to setup.  So have attached a workflow with it setup to Run your Command.

 

When it works correctly you should see 1 file written as your BAT file, and 1 file read from your Output.txt file.  They are both created in the Temporary directory, so once the workflow has finished they will be deleted.  Tip on the Results window, right click to open the Temporary Folder, so then you can view the files.

cmbarnett
6 - Meteoroid

Thank you! This worked great.

Labels