How get selected text from combo box

I want to get selected text from combo box and also selected value 

Hey Sandeep

When you are using a ComboBox you have some properties that you can access. As you can see in this documentation https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Traditional_Web/Web_Interfaces/Designing_Screens/Combo_Box_Widget (Value and Option) , let me know if you still have some doubts. 

João Moreira wrote:


I know how  can get the value but also looking for text(Source attribute) . I have combo box with Owner_name and Owner_code.

I am able get the value of Owner_code by variable but dont now how to get selected Owner name

Hey Sandeep

When you are using a ComboBox you have some properties that you can access. As you can see in this documentation https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Traditional_Web/Web_Interfaces/Designing_Screens/Combo_Box_Widget (Value and Option) , let me know if you still have some doubts. 



Hi Sandeep,

I replied to a similar question in the past:

https://www.outsystems.com/forums/discussion/42221/calculated-attribute-and-combo-box/

Can you check if it helps you?

Sandeep Khare wrote:

João Moreira wrote:


I know how  can get the value but also looking for text(Source attribute) . I have combo box with Owner_name and Owner_code.

I am able get the value of Owner_code by variable but dont now how to get selected Owner name

Hey Sandeep

When you are using a ComboBox you have some properties that you can access. As you can see in this documentation https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Traditional_Web/Web_Interfaces/Designing_Screens/Combo_Box_Widget (Value and Option) , let me know if you still have some doubts. 



Probably you will have to fetch the data of that Owner Entity with base on the code to get access to the other attributes like the Owner_code. 


I am not using entity I am filling the combo by rest call and dont want call again rest api for just only get owner name which is already available in combo box 

Well that being said my suggestion is to save the response on Local Variable (List) and use that list as the source of the ComboBox , and the use the pattern ListFilter to get the the Owner name , because as far as I know OutSystems will not keep the unused values in the ComboBox scope. 

You can use list filter on the source record list from the combobox to get the name (or other properties)

There was also an example like that in my previous post.

https://stackoverflow.com/questions/10194171/combobox-selectedtext-doesnt-give-me-the-selectedtext/10194263


You may have a js function that will call everytime you trigger the change property of the combobox.


I hope this helps :)

Hi sandeep,

The easy way is getting the ID on a Screen Action and querying the database to get the description text of the selected option.

You can also use some javascript in order to "copy" the description to a hidden field when the user changes the combobox, like this: https://jsfiddle.net/joaomelont/vtoxtwg7/

Best regards,

Nuno Verdasca