community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx Designer Knowledge Base

Definitive answers from Designer experts.

CS Macro Dev: Pop-Up Message

Alteryx Alumni (Retired)
Created on


This article is part of the CS Macro Development Series. The goal of this series is to communicate tips, tricks, and the thought process that goes into developing good, dynamic macros.

 

Are you tired of your boring old workflow? Just sitting there in your Designer, slacking?

  

bum.PNG

Get a job, ya bum!

 

 

Well, get ready to MAKE IT POP!

 

The attached example is an app that makes a pop-up whenever the user runs it as a workflow.

 

i.e.


run.PNG

 

rather than

 

wand.PNG

 

It creates a Visual Basic script that contains a command for creating a pop-up box with a customizable message and then executes it in a Run Command Tool.

 

 

2.png

The Write Source option is used to create the vbs script file. The file is then opened with CS-Script.

 

How does it "know" which button I pressed? 

The app makes use of the fact that Action Tools are not activated during regular workflow runs. This means that whatever they are configured to do only takes effect when the workflow is run as an app:

 

wand.PNG 

 

Capture.PNG

 

As evident above, the "DetourRight" value of the Detour Tool is set to True, so when you run it as a workflow it will divert the stream to the right. This stream has our Run Command on it, so you'll get a pop-up asking you to run it as an app.

 

If you oblige and do run it as an app (after all it did ask nicely), then the Action Tool will kick in, replacing the value for True with the value for False. This means the stream goes left, harmlessly past the Run Command Tool, and does not produce the pop-up window.

 

N.B. "True" and "False" are Boolean types, which are interchangeable with values 1 and 0, respectively.

Attachments