Custom trigger scenario

lau_sch
Level 2
Custom trigger scenario

Hello,

I would like to execute a scenario according to a custom trigger: after a scenario of another project and if it is Monday.
What is the best way to do this?

0 Kudos
1 Reply
ZachM
Dataiker

Hi @lau_sch,

From my understanding, you want the scenario to run after running another scenario, but only if it's currently Monday, correct?

You could accomplish this by using a custom Python trigger that checks for both of your conditions, but I think it would be easier if you used the following strategy instead:

  1. Add a "Run another scenario" step to the scenario that you want to run first, and configure it to run the second scenario that you want to be triggered.
  2. Use the following custom condition for the step:
    datePart(now(), "dayofweek") == 1โ€‹

    This will cause the step to run only if the current weekday is Monday (for more information, see Formula language | Date functions).

Preview:

image.png

 

Thanks,

Zach

0 Kudos