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 Knowledge Base

Definitive answers from Designer Desktop experts.

CS Macro Dev: Pop-Up Message

AlexKo
Alteryx Alumni (Retired)
Created


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 createsa 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

TheWrite Sourceoption 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 Toolsare not activated during regular workflow runs. This means that whatever they are configured to do only takes effect when the workflow is runas an app:

wand.PNG

Capture.PNG

As evident above, the "DetourRight" value of the Detour Toolis 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 itas 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