Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Update Value not producing expected output

JD_Smith
5 - Atom

Hello!

 

I want to dynamically update the Arguments value on a Run Command tool using a Control Parameter and an Action. In the attached example, the control parameter question is set to C:\temp\test.xls. The idea here is that a file path would be passed into the macro:

JD_Smith_0-1581008513395.png

The Action is set to update the value for Arguments, replacing the specific string FullPath.

JD_Smith_2-1581008992253.png

The expected behavior is an Arguments value of ".\test.vbs" "C:\temp\test.xls". The included VBS file simply assigns the argument to a variable and does an echo to demonstrate that the Arguments value is not actually being updated. The expected output of the message is "C:\temp\test.xls", but instead we get "FullPath". Here is the expected output when run from the command prompt:

JD_Smith_1-1581008924945.png

Does anyone have any advice regarding how to make this work? Thanks in advance!

 

Best Regards,

JD

6 REPLIES 6
danilang
19 - Altair
19 - Altair

Hi @JD_Smith 

 

The control parameters and associated Action tools are only applied when the macro is included in a calling workflow.  It's the values that are passed in to the control parameter of the macro that are used by the Action tools  on each of the macro's iterations.  

 

Create a test workflow and include the macro in it. 

 

Dan

JD_Smith
5 - Atom

Hi Dan,

 

Thank you for your feedback! Would you please elaborate? I test complex macros without the calling workflow on a regular basis with no unforeseen consequences. Is there something that is unique to this macro setup?

 

edit: I should elaborate; I regularly do standalone testing of macros that contain control parameters that update some property. I have, however, never connected it directly to an action. Is this really the problem?

 

-JD

danilang
19 - Altair
19 - Altair

Hi @JD_Smith 

 

The difference here is that there is no way within a batch macro to specify the value that FullPath control parameter will use to replace the FullPath string.  .  The Macro Input tool allows you to set up template data to use while debugging, but there's nothing similar for the Control Parameter.   The control parameter needs to be passed in from a calling program.

 

Dan

JD_Smith
5 - Atom

Hi Dan,

 

Sure enough it works! Thanks!

 

What I still do not understand is why the Control Parameter works in the attached macro without a calling workflow. I can set the Control Parameter value in workflow configuration on the workflow tab and the result is that the control parameter drives the Filter value.

JD_Smith_0-1581011431898.png

The fact that it works here, but not with an Action in my other example is quite confusing and counter-intuitive to me!

 

Thanks!

JD

danilang
19 - Altair
19 - Altair

Hi @JD_Smith 

 

It's the Action Tool that makes the difference.  The action that it takes is only triggered when the macro is called from a workflow.  When you connect the parameter directly to the Q input, it's the formula in the connected tool that does the work and this always runs.

 

Dan

 

JD_Smith
5 - Atom

Thanks again! Lesson learned: Actions in a macro need to be tested using a calling workflow. I assume that this is for the same reason why one must run the Action example as an application in order to see the example work.

 

Best Regards,

JD

Labels