430
Views
5
Comments
Solved
custom dropDown list

Hello There , 

i want you to teach me how to fill dropDown with two options 

Year(CurrDate()) ,  

Year(AddYears(CurrDate(),-1))

i used  year function because i want the values be dynamic in the dropdown 

so please tell me how to implement this 

see the pic in attachments to understand more what i mean 


dropDownYears.png
UserImage.jpg
vikas sharma
Champion
Solution

Hi,

First you create a local variable of type list of date or may be text as well. Then in onInitlize() screen action you can call above logic of get Current Year, Current year +1...... . Like this can create a list. Then use this list on screen in dropdown.

regards

2024-12-19 07-54-27
Aditya Chinchole
Solution

Hi @Bashayer Alghamdi ,

What Vikas said is correct.

I have attached the oml file which satisfies your requirement i.e populating Dynamic Years in dropdown.

What I have done is, assign a list to dropdown, On Onready event call list append and assign the dynamic values to the dropdown list. There are many ways to do this as well.

https://personal-iskczduo.outsystemscloud.com/YearsDropdown/DropdownYears

Hope this helps !

Regards,

Aditya

YearsDropdown.oml
UserImage.jpg
vikas sharma
Champion

Hi,

As for dropdown you need to pass a list as data source. So using above Year method you can create a local list in start then use that list here in drop down as data source.

regards

UserImage.jpg
Bashayer Alghamdi

thank you Mr. Vikas for replay 

but please how can i define local list and fill it with the years ?

UserImage.jpg
vikas sharma
Champion
Solution

Hi,

First you create a local variable of type list of date or may be text as well. Then in onInitlize() screen action you can call above logic of get Current Year, Current year +1...... . Like this can create a list. Then use this list on screen in dropdown.

regards

2024-12-19 07-54-27
Aditya Chinchole
Solution

Hi @Bashayer Alghamdi ,

What Vikas said is correct.

I have attached the oml file which satisfies your requirement i.e populating Dynamic Years in dropdown.

What I have done is, assign a list to dropdown, On Onready event call list append and assign the dynamic values to the dropdown list. There are many ways to do this as well.

https://personal-iskczduo.outsystemscloud.com/YearsDropdown/DropdownYears

Hope this helps !

Regards,

Aditya

YearsDropdown.oml
UserImage.jpg
Bashayer Alghamdi
Hello Vikas Sharma and Aditya Chinchole , thank you very much for your time , its work now as i want
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.