Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Need to sneak a global variable into a macro

KaiLarsen
10 - Fireball

In everything I've read, there is no easy way to set a global workflow value once and have it go into 20-30 copies of the same macro without a separate connection into each macro. I imagine I could cleverly have the user input it and save it to a file and then pull it from the file from inside the macro, but I'm looking for a more elegant hack. Any thoughts? Any clever way to sneak a value from the workflow constants or other type of user input into a bunch of macros without messing up the workflow, as the users are beginners who I don't want to confuse.

 

 

7 REPLIES 7
Qiu
21 - Polaris
21 - Polaris
KaiLarsen
10 - Fireball

Sadly not. User constants are not available inside a macro, probably because macros are developed as separate workflows.

Qiu
21 - Polaris
21 - Polaris

@KaiLarsen 

Sorrt about that misunderstanding.

Just an idea

Case 1, if required workflow constant or user input is in the input for macro, maybe create another standard workflow inside the existing one, to process data and feed the data inside the existing macro.

Case 2, if equired workflow constant or user input is NOT in the input for macro, you will need to reconnect the macros anyway to give the data feed.

KaiLarsen
10 - Fireball

Hi again, Qiu,

 

Thanks for not giving up.  I didn't quite follow the two proposals. Let me try to explain my need a bit better:

 

1. We have created a macro that connects to an API that contains a number of data tables with a table Id.

2. We have developed a set of workflows with 20-30 text input tools with data along with a problem statement and the macro.

3. The users are supposed to build out the workflow between the text input and the macro, which will examine the result and tell them whether they solved the problem correctly.

4. We need to know the name of the user who is running the workflow and feed that into the macro (somehow).

5. Because the users are completely new to Alteryx, we don't want to create an analytic app (they should run the workflow as normal) and we don't want unnecessary connections into the 20-30 copies of the macro.

 

In short, we want the user of the workflow to update their name *one* place, and for that name to then flow into all the macro copies to be reported to the server on the other side of the macro.

 

Do you think either of your solutions can help with that?

 

Kai 🙂

Qiu
21 - Polaris
21 - Polaris

@KaiLarsen 
Thank you for the detailed information and I am still  trying to figure out the whole picture here.

But one thing I know now is that you want to incorperate the UserID who runs to flow into the output.

As a start, maybe we can work on how to get the userID who runs the flow?

I create a sample and hope it works for your bussiness case.

Capture1A.PNG

KaiLarsen
10 - Fireball

Thanks Qiu, but this really has nothing to do with my underlying problem. 

ThomasT
8 - Asteroid

@KaiLarsen I just came across the same issue. I want to pull the [Engine.WorkflowFileName] into a macro that sits inside that workflow. Unfortunately when running the macro I get this output which is quite interesting "[Unnamed Module]" so it definitely doesn't pull in the workflow name, but it also doesn't remember it's own workflow name (maybe because it changed to a .yxmc and the workflow name constant doesn't exists anymore). 

 

Let me know if you have found a good workaround, all I can think of is to add a control paramenter to the macro but I wanted to avoid that at all cost.

Labels