Page 1 of 1

Script help

Posted: 11 Jan 2020 00:10
by Jptooch
I currently have a flow that helps me at work. When I trigger the flow, it will simply put the "trigger time" in the notification area on my phone. The script I use to get the trigger time is {triggertime,dateformat,hh:mm} . Here is where I need help. What script string would I use to take the trigger time and add 30 minutes to it? For example, if I execute the flow at 10:00, 10:30 is the time that would display.

Thank you in advance.

Re: Script help

Posted: 11 Jan 2020 01:25
by Desmanto
use addMinutes(). While you can add the time directly to the triggertime, it is a better practice to modify it in other variable first.

Code: Select all

tt = addMinutes(triggertime, 30);
then use {tt,dateformat,hh:mm} in your notification.

Re: Script help

Posted: 11 Jan 2020 02:14
by Jptooch
Thank you

Would I add the string tt = addMinutes(triggertime, 30); to a global variable? I'm not sure where to add it?

Re: Script help

Posted: 11 Jan 2020 03:03
by Desmanto
No need to do so. All variable are default to local variable, only exist during flow execution and destroyed after flow stop. You only need global variable if you want to use this variable in other flow, which I don't think you need it here. If you really need it later, you can simply add global_ tag to the variable name.

Code: Select all

global_tt = addMinutes(triggertime, 30);
Then use {global_tt,dateformat,hh:mm} in your other flow.