Stop the input dialog action if timeout occurred.

Post your questions and help other users.

Moderator: Martin

Post Reply
wfrcrd
Posts: 116
Joined: 27 May 2015 08:57

Stop the input dialog action if timeout occurred.

Post by wfrcrd » 24 Dec 2018 10:23

It's possibile?
If yes, how?

I've made another flow wich stop the main one some seconds before the input dialog timeout occurr,
but it's an ugly workaround.

Thank you !

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Stop the input dialog action if timeout occurred.

Post by Martin » 24 Dec 2018 13:43

Could you please clarify what you want to achieve?

Action Input Dialog has an option to specify a timeout. The variable operation will be set to value timeout when the dialog is closed by a timeout. You can use a condition Expression to check this and stop the flow (for example using script: operation=="timeout").

Regards,
Martin

wfrcrd
Posts: 116
Joined: 27 May 2015 08:57

Re: Stop the input dialog action if timeout occurred.

Post by wfrcrd » 24 Dec 2018 14:19

Sorry for my bad english:
if timeout occurred value is filled with "default" and the flow continues.
I'd like to stop the flow if a timeout occurred, and if it's possible , even if the "cancel" button (on the dialog window) is pressed.
( I'm re-reading the help page...)

So as you said I need a condition expression to check if "operation" is ="timeout" or "cancel" and in one of this case stop the flow.

Thank you for your patience!

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Stop the input dialog action if timeout occurred.

Post by Desmanto » 24 Dec 2018 17:08

As Martin pointed out, the key is in the {operation}. This variable can have 3 possible value
1. "ok", You put in proper input (before timeout) and press OK
2. "cancel", You press cancel button (before timeout) or press back button.
3. "timeout", you didn't put anything or press OK or cancel until timeout

If you like to continue the flow, ONLY if you put proper input (before timeout), use expression

Code: Select all

operation == "ok"
I use this kind of expression so far, for 25+ times, not including the variant of it. I usually put it after the input dialog, to protect the rest of the flow from executing, if timeout or I cancel it.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: Stop the input dialog action if timeout occurred.

Post by anuraag » 25 Dec 2018 00:05

@Martin can you add option to change Variable name in input dialog. Sometimes i use more than 1 input dialog and need to change default Variable by using script/expression.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Stop the input dialog action if timeout occurred.

Post by Martin » 29 Dec 2018 14:20

@anuraag This is on my list of features under consideration. For the time being you have to add an action Script after the input dialog action and assign the variables to another variable before you show the next dialog.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Stop the input dialog action if timeout occurred.

Post by Desmanto » 30 Dec 2018 11:47

+1 for this. Although we can simply assign it first to other value, sometimes, giving it direct variable name is simpler.

Meanwhile, most of my flow which need multiple input dialog dialog consecutively, usually protected by the operation == "ok", but added up another value assignment. So if I have 3 input dialog, I usually have 3 expression also after each input dialog, with at least 2 of them (sometimes just all of them) have the value assignment.

Code: Select all

choice_level1 = value;
operation == "ok";
2nd expression

Code: Select all

choice_level2 = value;
operation == "ok";
3rd expression

Code: Select all

choice_level3 = value;
operation == "ok";
later you can usee choice_level1, 2, 3 in the next step.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: Stop the input dialog action if timeout occurred.

Post by anuraag » 30 Dec 2018 11:59

I am doing same now. Changing variable name inside expression.

It will be also nice to have an option inside input dialog to abort/stop flow on cancel/timeout. This will help us to no more use additional expression.

Post Reply