How to include value on list picker like selectbox behaviour on HTML?
as illustration below
Because I need to save key_id value on list picker selected text.
How to include value on list picker like selectbox behaviour on HTML?
as illustration below
Because I need to save key_id value on list picker selected text.
Welcome to the community. Please be more specific cause I do not understand what you want to do. Also in order to get help see how to …
this is illustration that i mean. I need to get “002” value if i choose “Banana”.
Now i understand
just make a list fruits = (mango banana tomato)
When option selected
Set value to index in list thing = option and list = fruits
@iamwsumit this is a good method.
I want to add some info.
If you want to use something like selectbox in HTML, you can use the Spinner
component.
Or as your first post said, you can use LIst Picker.
Use set element (the green block) to set the list.
If you are using List picker:
If you are using Spinner:
The selection index indicate the index of your selection (start from 1)
As you said, the value is also a number so you don’t need to do anything else.
I think I tried this method, running well if i choose fruit without search before. but I found mismatch value_id from option value when i use search feature of fruits.
Maybe This:
Create your list with PrimaryKey-FruitName
95-Apple
56-Banana
87-Orange
After the user selects, separate the string in the hyphen “-” ( red block Split Text at ) and take the first item that will be your primary key
Try using dictionary too if you want.
make dictionary
{"apple":"001", "orange":"002","banana":"003"...}
Then use key
in dictionary to get list of items.
After picking, use get value with the selection to number.
I hope to hide 3 left character for it solution.
I tried your solution, and This is my block,
I failed split “kode” and “nama_wil” to listpicker although using “get value at keypath” of dictionaries. What is wrong…?
Show you full blocks please. I couldn’t help with that