Page 1 of 1
Periodic Timer - Using variable
Posted: 20 Jun 2018 11:32
by xpdev
Hi Martin, a little request, if possible.
When setting "Period timer" , field "Interval" accept only string value, but not variable.
Is it possible to make a change in order to use a variable in the "Interval" field?
This modification would make the same "Flow" usable by modifying the range of use simply by changing the variable value.
Thanks
Re: Periodic Timer - Using variable
Posted: 20 Jun 2018 17:06
by Desmanto
I might need this some day, so +1.
Meanwhile, the other workaround for it is using Glovar datetime. Use a glovar datetime trigger and use a glovar for it. In each execution use
Code: Select all
global_period_timer = getDate() + global_period_interval;
So every execution will add the current time to the interval you have, essentially making it to execute again after the interval. The downside is you need the extra glovar to store the time.
Re: Periodic Timer - Using variable
Posted: 21 Jun 2018 07:44
by xpdev
Thank you, waiting Martin answer, i'll use your way.
Re: Periodic Timer - Using variable
Posted: 21 Jun 2018 19:32
by Martin
Hi,
I recommend to use the method Desmanto mentioned. Supporting variables in triggers is on my todo list but has quite a low priority since I did not yet have a good general idea how it can be achieved in a way that does not lead to unexpected side effects and performance issues.
One option might be to consider the variables only at the time the trigger is registered but not afterwards so you would have to disable and enable the flow when the variable is modified. Would this be helpful to solve your case?
Regards,
Martin
Re: Periodic Timer - Using variable
Posted: 22 Jun 2018 08:24
by xpdev
Thanks for the reply Martin
"Would it help to solve your case?"
No, it would not be useful, the variable could change and it would be a problem to deactivate and reactivate the flow.
I have tested the method Desmanto mentioned, it works well and not problems.
Ps Martin this is a great app !!!