Input dialog default value

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
giovag7
Posts: 58
Joined: 05 Mar 2013 10:02

Input dialog default value

Post by giovag7 » 04 Aug 2014 09:44

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?

User avatar
kintrupf
Posts: 257
Joined: 10 Sep 2013 08:59

Re: Input dialog default value

Post by kintrupf » 04 Aug 2014 10:10

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}.

User avatar
giovag7
Posts: 58
Joined: 05 Mar 2013 10:02

Re: Input dialog default value

Post by giovag7 » 04 Aug 2014 11:12

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?

User avatar
kintrupf
Posts: 257
Joined: 10 Sep 2013 08:59

Re: Input dialog default value

Post by kintrupf » 04 Aug 2014 12:00

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.
flow_Multi_choice_example_20140804_135113.zip
(879 Bytes) Downloaded 872 times

User avatar
giovag7
Posts: 58
Joined: 05 Mar 2013 10:02

Re: Input dialog default value

Post by giovag7 » 04 Aug 2014 13:51

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.

angelatwork
Posts: 186
Joined: 12 Feb 2014 01:45

Re: Input dialog default value

Post by angelatwork » 08 Aug 2014 08:36

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 :-P.

http://automagic4android.com/flow.php?i ... a94b7f9df2
Best regards,
AngelAtwOrk

Post Reply