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.

Batch Macro with Command Line

Link86
8 - Asteroid

Hi,

I am trying to create my first Batch Macro in which the data that should be ran through is some command line code that is created with a formula tool in the workflow. I think my trouble is configuring the input tool. My action tool will update the Command Arguments field which I believe is correct but not sure until I  actually run the thing (included a picture of the current configuration in case you see something not right to save me from another posting possibly 😁). The macro will basically unzip files in their current location using powershell. I have tried with and without the Macro Input tool and I get errors both ways. I am not sure how to configure the input tool or even what to have it input. Any advice would be helpful. I have included images of the workflow and macro below.

 

Error with Macro Input: Error: MacroForPowershellUnzip (6): The macro is not configured: missing field map for "Input7"

Error without Macro Input: Record #19: Tool #3: Either an Output connection or Input connection is required.

 

Any help would be great.

 

Macro

 WorkflowCapture.JPG

Capture2.JPG

 

Run Command Config.

Capture3.JPG

6 REPLIES 6
mbarone
16 - Nebula
16 - Nebula

You shouldn't need the macro input tool.  Can you show us the configuration of your Action tool?  Probably something simple in there.

Link86
8 - Asteroid

Sure, here is a screen shot of the Action tool configuration. 

 

Capture4.JPG

mbarone
16 - Nebula
16 - Nebula

And I'm assuming the argument you're feeding into the action tool is the proper syntax for powershell.  If so, that looks good.  Try using for the command "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" (or wherever it's located on your machine).

apathetichell
18 - Pollux

There are a slew of problems here but the first and biggest one is:

 

There are two inputs in your batch macro - a datasource and a control parameter. You are missing the datasource input. You have to attach your data to the other anchor of your batch macro - not just to the control parameter anchor, or you have to get rid of the macro input in your batch.

 

Your action tool needs to be configured to change the part of your command line which you are trying to change (ie command arguments). It's easier to do this if you have a sample zip line there with the parameters which you are changing with the control parameter. then your action tool can highlight and replace what you are trying to change.

 

 

Link86
8 - Asteroid

I have changed the command to the above. I also made sure the PS command worked in powershell again just to be safe by accessing it via the command you provided. That worked as well. Below are the two screen shots and the errors that I am encountering. This time, I have removed the macro input tool. 

 

By the way, thank you for your help so far on this.

 

Workflow:

Capture.JPG

 

Macro

Capture2.JPG

 

 

mbarone
16 - Nebula
16 - Nebula

Sure.   The Command tool isn't the easiest of tools to figure out.  Most important things are that command line that points to the EXE and the arguments.  I suggest reading through the help files for it (just click on it on the Canvas, then click F1 and the help files will open for it).  And always a great place to get good tips/information on tools is the Tool Mastery Index  (just scroll down to find the Command tool under Developer).  

Labels