How to schedule an OnEvent scenario

Are you planning a holiday, but you want to schedule your OnEvent scenario now? We got you covered with this guide.

There is a possibility to make a custom JINJA condition that will start matching customers only from some point of time in the future.

You would need a bit of JINJA code and this website

The Jinja code which you need to insert into a custom-coded condition is this one

{% set ScheduledTime = 1680683755 %}
{% set CurrentTime = time %}
{% if ScheduledTime <= CurrentTime %}
{% else %}
{% endif %}

You need to set two variables, one is ScheduledTime, which represent the UNIX timestamp of the DateTime from when you want this scenario to be active, and the second variable is the CurrentTime which is literally the current UNIX timestamp.

Then you need to use a simple if condition that will check if the ScheduledTime is less or equal to the current time, and if it is, the condition will be matched due to rendered True statement.

If the ScheduledTime is bigger than the CurrentTime, the condition will not match anyone due to rendered False statement.

All you need to do when you want it to schedule for a particular time is to go to the above-mentioned UNIX timestamp website, enter the day and time when you want the scenario to become active and copy the UNIX timestamp and paste it into the JINJA code.

After this, you need to insert the JINJA code inside the condition. This is done easily by switching to the code editor.

Now you are ready to go, you can insert this condition behind your OnEvent trigger and start your scenario. It will be triggered by a OnEvent, but this condition will start letting customers go through only after the ScheduledTime is reached. You can remove that condition when needed after you return.


Did this article help you?

Please provide your feedback. We would like to know if our help center is effective in solving your queries. You can also leave comments and suggestions on how we can make our help articles better. You can also suggest topics you’d like us to cover.