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).
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"?
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.
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}}
you can use this widget to return json data and use it as you like, https://community.bonitasoft.com/project/widgetautocompletekey