45
Views
9
Comments
Need Help Retrieving Attribute Names for Dropdown List in OutSystems
Application Type
Reactive

Hi everyone,

I'm currently working on a project in OutSystems and I'm facing a challenge with dropdown lists. I'm trying to get the attribute names for a dropdown list, but I'm not sure how to do it.

Could someone please guide me on how to retrieve attribute names for a dropdown list in OutSystems? Any help or examples would be greatly appreciated!

Thanks in advance!

2023-12-28 15-13-10
Mauro Alviza

Hi Anitha!

If you are using Dropdwon search or dropdown tags widget, you can do that on the OnChange Event.

If you go to the OnChange Event and create a client action linked to that dropdown, it will create an action that has as input a SelectedOption List. There you can retrieve the names, they must be the value.

Tell me if it helped!

Cheers.

2023-11-15 06-03-38
Anitha

Thanks for your response.Dropdown search and dropdown bring an attribute value based on ID. Is it possible to retrieve attribute names? For example, if an employee has attributes like name and age, I would like to display name and age in the dropdown. 

2023-12-28 15-13-10
Mauro Alviza

The id is the identifier of the record, but it will show the name yes. In the dropdown, you just need to put the "entitiy.name" on the "Options Text", that it will show the name:

On the Dropdown Search, you just need to put the "entity.name" on the label value, that it will show the name:


2024-01-20 14-53-12
Ahmed Essawy

First I recommend to go through  below Outsystems react training that will better help you over all.

https://www.outsystems.com/training/paths/18/becoming-a-reactive-web-developer/ 

Please find below steps to add a drop down.

1. Create Entity 

2. Enter some records in it

3. Drag and Drop DropDown Control on screen

4 Add a Aggregate of the newly created entity to the screen

5. Assign the List Property of DropDown via Aggregate  return list

Attached is the oml.

DropDown.oml
2023-11-15 06-03-38
Anitha

Thanks for your response.dropdown bring an attribute value based on ID. Is it possible to retrieve attribute names? For example, if an employee has attributes like name and age, I would like to display name and age in the dropdown.

2024-01-20 14-53-12
Ahmed Essawy

yes, check below for your reference (display name + age) as requested .. also an example is attached..




Dropdownlist_V2.oap
2023-11-15 06-03-38
Anitha

I understand your logic, but I need to display attribute names in the dropdown, such as 'name' and 'age,' not the values. Thanks for your response

2024-01-20 14-53-12
Ahmed Essawy

my solution displays multiple attribute names in the dropdown, 'name' + 'age,' not the values, I can't get your concern.  

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.