Get Dropdown label instead of the value

23 views
Skip to first unread message

Daniel R.

unread,
Sep 3, 2025, 6:48:56 PMSep 3
to Orbeon Forms

Hello,

How can I transfer the label from a dropdown entry to a text box instead of the value from dropdown.

Example:
concat($name-2, ' ', $teil-2)
$teil-2 ist the dropdown, but I get the value instead of the label.

Best regards, Daniel

Alessandro Vernet

unread,
Sep 4, 2025, 12:08:52 AMSep 4
to orb...@googlegroups.com
Hi Daniel,

In some cases, you can use an expression like the one below, replacing NAME with the control name you assigned to your dropdown. However, this doesn't work in all contexts, for example, it won't update immediately when used in a Calculated Value. Could you tell us more about your specific use case?

xxf:itemset('NAME-control', 'xml', true())//item[@selected = 'true']/label

-Alex

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orbeon+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/orbeon/de895110-6666-4c2f-ac72-c28761edb66fn%40googlegroups.com.

Daniel R.

unread,
Sep 4, 2025, 1:04:54 PMSep 4
to Orbeon Forms
Thanks Alex for your reply.

I need to combine the values from both fields into one field. The text field (left) is no problem, but for the dropdown on the right, I want the label and not the value. Ideally, the values should be written to the third field when leaving the fields.

Unfortunately, the upper solution does not seem to work for my case.


unnamed.png
Best regards,
Daniel

Alessandro Vernet

unread,
Sep 4, 2025, 7:03:37 PMSep 4
to orb...@googlegroups.com
Hi Daniel,

Got it. If you want to access the label from a Calculated Value, and the choices are defined statically in Form Builder, use an expression like the one below, replacing `choices` with the name of your dropdown control. I've also attached the form source that demonstrates this. Please let me know if it works for you.

    $form-resources/choices/item[value = $choices]/label

-Alex
Itemset from model.xml

Daniel R.

unread,
Sep 5, 2025, 10:28:02 AMSep 5
to Orbeon Forms

Hello Alex,

Thank you for your great help. It works perfectly.

Best regards, Daniel

Alessandro Vernet

unread,
Sep 5, 2025, 6:52:55 PMSep 5
to orb...@googlegroups.com
Excellent, Daniel, and thanks for the confirmation.

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orbeon+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages