Page 1 of 1
Input dialog default value
Posted: 04 Aug 2014 09:44
by giovag7
Hi all,
i want to create a multi choice (two values) input dialog that "remember" the last choice every time i open it, but i have problems to do that.
Input dialog supplie a variable "value" that contains the choice made enclosed in [].
If i use this variable "value" in the field "default value" of input dialog, i expect that every time i open that input dialog i see last selected choice, but is not so.
How I can make this working?
Re: Input dialog default value
Posted: 04 Aug 2014 10:10
by kintrupf
giovag7 wrote:If i use this variable "value" in the field "default value" of input dialog, i expect that every time i open that input dialog i see last selected choice, but is not so.
How I can make this working?
It works for me. Put a variable with a list of options in the
List Values parameter and the already selected ones in the
Default Value parameter.
Make sure both variables contain a comma separated list of options, the second variable should of course contain some strings from the first to select.
And put both
variables in curly braces like {var1}.
Re: Input dialog default value
Posted: 04 Aug 2014 11:12
by giovag7
kintrupf wrote:giovag7 wrote:If i use this variable "value" in the field "default value" of input dialog, i expect that every time i open that input dialog i see last selected choice, but is not so.
How I can make this working?
It works for me. Put a variable with a list of options in the
List Values parameter and the already selected ones in the
Default Value parameter.
Make sure both variables contain a comma separated list of options, the second variable should of course contain some strings from the first to select.
And put both
variables in curly braces like {var1}.
Sorry, but i can't understand how to use variable containing list {list,listformat,comma}. In my flow i simply used a text list "Option1, Option2". Could you upload a working example?
Re: Input dialog default value
Posted: 04 Aug 2014 12:00
by kintrupf
giovag7 wrote:Sorry, but i can't understand how to use variable containing list {list,listformat,comma}. In my flow i simply used a text list "Option1, Option2". Could you upload a working example?
No problem, please take a look at the attached flow. It defines a list of 5 options of which 2 are selected when the
Input Dialog opens.
The
Script action is used to fill the two list variables "available" and "selected" which are then used to populate the
Input Dialog.
Re: Input dialog default value
Posted: 04 Aug 2014 13:51
by giovag7
http://automagic4android.com/flow.php?i ... ba37b8afb5
Ok thank you. Now i found the way to obtain what I mean. I made some mod to your flow. Now it "remember" the last choice.
Re: Input dialog default value
Posted: 08 Aug 2014 08:36
by angelatwork
Interesting, thank you both for sharing. Giovag7 I don't think you need the scripting part selected = newlist() to make your flow work the way you want. See this revised flow. Less is more

.
http://automagic4android.com/flow.php?i ... a94b7f9df2