Hi,
if you want to show elements of a list (list=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) in Eingabedialog, elements will be showed this way:
[1
2
3
4
5
6
7
8
9
10]
If you use the variable 'value' (=selected element),
it includes '[' and ']' and ' ' (=space).
Therefore you have to use the following syntax to show the elements correctly:
{replace(replace(replace(list,"[",""),"]","")," ","")}
It would be better without this work around.
http://automagic4android.com/flow.php?i ... daa1cf2018
Elements of a list not correctly shown in Eingabedialog
Moderator: Martin
-
- Posts: 53
- Joined: 17 Mar 2013 16:08
Re: Elements of a list not correctly shown in Eingabedialog
Looks like elements gots handled as strings in your way of definition.
The [ and ] becomes part of the list entry.
The only time I 've used a list in Automagic I defined this way
mylist = newlist("Element1", "Element2", ...)
which works good for me.
LiTe
The [ and ] becomes part of the list entry.
The only time I 've used a list in Automagic I defined this way
mylist = newlist("Element1", "Element2", ...)
which works good for me.
LiTe
-
- Posts: 56
- Joined: 16 Mar 2013 14:10
Re: Elements of a list not correctly shown in Eingabedialog
Just tried it with addElement and it gets same incorrect result. May be bug in input dialog?
Re: Elements of a list not correctly shown in Eingabedialog
The field "list values" in the action input dialog accepts a list of comma separated values:
val1,val2,val3,"val with comma a, inside"
shows (for type=Single Choice):
val1
val2
val3
val with a comma, inside
Assume you have created a list with numeric values somewhere in a script:
list_xyz = [1 to 10];
or
list_xyz = newList("a", "b", "c");
You can show a single choice input dialog like this (type=Single Choice):
{list_xyz,listformat,comma}
This will convert the list to the comma separated values syntax (also handles escaping of commas in the values of the list).
Martin
val1,val2,val3,"val with comma a, inside"
shows (for type=Single Choice):
val1
val2
val3
val with a comma, inside
Assume you have created a list with numeric values somewhere in a script:
list_xyz = [1 to 10];
or
list_xyz = newList("a", "b", "c");
You can show a single choice input dialog like this (type=Single Choice):
{list_xyz,listformat,comma}
This will convert the list to the comma separated values syntax (also handles escaping of commas in the values of the list).
Martin
Re: Elements of a list not correctly shown in Eingabedialog
Hi Martin,
it works.
Thank you.
it works.
Thank you.