Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
SOLVED

How to manipulate the flow depending on schedule / manual run

Diederik_vanderharst
8 - Asteroid

Hi All,

Here is my use case and problem.

I have an app that would usually run scheduled in server using a bunch of parameters. However, I also want people to be able to go into server, find the app and feed their parameters. The flow should then figure out which parameters to use: the default ones, or the ones given.
I figured using variables like __cloud:UserId and Engine.GUIinterface would get me there, but both remain empty when the app is started from server. I would expect at least a UserId to not be empty.


Does anyone have an idea which variable will get me there?

Here's the scenario's:
1. Someone runs the app from designer (GUI = True, UserID = null) Flow will use user given params. This is good.
2. Someone runs the app from Server (GUI = False, UserID = null) Flow should use user given params, but now uses defaults. I expected UserId to return an Id to define the scenario, but it returns nothing.
3. Flow runs on a schedule (GUI = False, UserID = null). Flow uses default params. This is good.

Basically I'm saying or want to say: IF GUI = TRUE or Some other variable that indicates manual prompting (in gallery) then use user given params. Otherwise, use defaults.

Any input would be appreciated.

3 REPLIES 3
Dean4U
Alteryx
Alteryx

Hi @Diederik_vanderharst,

 

Thanks for reaching out to us. It looks like you can’t differentiate between a user-triggered Gallery run vs a scheduled run, and you want to ensure that the user-supplied parameters are run manually via the Gallery and use default parameters when run as a scheduled job. 

 

I found a link where a similar discussion took place on automating the app based on different user inputs. One of the responses suggests combining the Directory tool and other preparation tools(filter) to achieve this:

 

https://community.alteryx.com/t5/Alteryx-Server-Discussions/Make-Alteryx-App-run-automatically-when-...

 

From what I read online, a manual user-triggered run in the Gallery always shows the interface questions, whereas a scheduled run does not show the interface as it uses saved values or defaults.

 

In your case, you can set a condition through a formula tool where if a parameter value is equal to the default, it assumes that it’s a scheduled run, whereas if the parameter is not equal to the default, it assumes it was a manual/Gallery run. A formula tool with an If/else condition that uses default parameters on scheduled runs and user input in other cases could work. In this case, you can modify your interface tools to use special default values like "_SCHEDULED_" or something similar.

 

Give it a try and let us know how it works out.

 

Hope this helps.

 

Take care.

Diederik_vanderharst
8 - Asteroid

Thanks for your reply @Dean4U , I've stumbled upon a lot of new knowledge surrouding this. The key phrase here is (and I wish I had found it earlier, so I put in all caps so others cannot miss it) "ACTION TOOLS DO NOTHING IN A SCHEDULED APP". This implies the defaults + scheduled-or-not-logic need to be applied in the regular tools, not in interface tools. Combining GUI-interface + __cloud:UserId I have then created logic that determines what needs happen and which (dynamic) values go into which parameters.
Also I found that I had made mistakes configuring the textbox for UserId resulting in nulls, which I why I link to that topic here too.

Dean4U
Alteryx
Alteryx

Hi @Diederik_vanderharst,

 

Sorry for the delay in my response. I was out of the office and could not get back soon enough. :)

 

Thank you so much for working on this. I learned while working on this post that we cannot make action tools do anything during scheduled runs, and we can use conditional logics through the Formula or Filter tool to create conditions to make it work. Really appreciate you letting me know that you were able to make the workflow work for you. Huh, I might have slightly overused the word 'work'!

 

Glad I was able to learn with you.

 

Reach out to the community if you need any help in the future.

 

Take care.