Select Widget - How to pass two values ?

Hey guys,
In a select widget you can set the displayed key (in my case: E-Book), returned key (in my case: 490$) and the value (in my case $item.price).
xcxcxcxc

My problem is, that I need to fill two variable, because on the next page I want to see what the customer choosed and what the price is. For now, I only see the price.
How can I set the name of the product (->E-Book) and the price (->50$), by selecting “E-Book”?

I tried to write both things in one inputfield like:
cccxxxxx

Add to an id to your json and return the id from the Select widget.
Also add the same json to the next page and you can show selected e-book(product[id].ebook) and the price(product[id].price)

you can use this widget to return json data and use it as you like, https://community.bonitasoft.com/project/widgetautocompletekey

@dkoume_1353153
thanks for the fast answer. Sorry, Im new to this whole stuff and dont know how to do that :confused:
I tried to do something like that with a javascript in the ui-designer, but then I didnt know how to reference to my javascript. I did something like this:
yxcyxcyxc
xcsdfsds

@msakirkutlu_1359205

thanks for the fast answer. But how can this widget help me with my problem? I have there also only one value I can set. But I need set to variables for the next page.
For now Im only setting one variable and this is the price.

your json should look like this
[
{“id”:0,“label”:“ebook”,“value”:“490”},
{“id”:1,“label”:“Presse”,“value”:“2800”},
{“id”:2,“label”:“Textbook”,“value”:“800”}
]
and your widget should configure like this
Display key:label
Return key:id
value:id
and you can show it:{{product[id].label}} ,{{product[id].value}}

that widget returns all values for selected line. for example,
[
{“id”:0,“label”:“ebook”,“value”:“490”},
{“id”:1,“label”:“Presse”,“value”:“2800”},
{“id”:2,“label”:“Textbook”,“value”:“800”}
]
if you fill that widget with this json data then create a new variable as empty json named “selectedData” and set value field in widget with that “selectedData” variable. when you selected an object like “ebook” it will return to you all this like {“id”:0,“label”:“ebook”,“value”:“490”}, after that you can get values as you want, selectedData.label, selectedData.value, selectedData.id etc.

ok, thanks, it works!:slight_smile: You both helped me and both solutions worked for me :slight_smile:
I would like to mark both as the best answer :confused: but cant

It is really rare that someone answers here in the forum. So thanks alot! I appreciate it

@msakirkutlu_1359205
Hey, I got another problem. Your solution works only for one field, but I have a Button “add” to add new field to a collection. I guess the problem is that after adding a second field, both fields are using one and the same selectedData-Json-Object :confused: You know how to fix that?