I have a drop-down and I want to show a specific value from the database entity as it's default value. But, the specific record is present somewhere in between in the entity, so sorting the table on the basis of id will not help. So, how do I show that specific value from database as default value in drop-down.
For eg:
In my table I have records in the following order:
Id. Name
1. Cat
2. Dog
3. Monkey
4. Elephant
Now, in my drop-down I want to show "Dog" as the default value. So, how can I do it?
Hi Runisha,
You have to follow similar approach.
If Dropdown local variable data type is text then give default value "Dog".
If it is identifier and entity is not static entity, in this situation - you have to provide identifier.
Let suppose you want to show Dog as default value in dropdown. SO you have to give Id of "Dog" in default value. We know it is 2. Use IntegerToIdentifier() built in function to convert 2 in identifier.
Please check- Demo Screen and attached OML.
Hope this help.
Thank you
Hello Runisha,
What's your application type reactive or traditional?
If it's traditional then please check below post,
https://www.outsystems.com/forums/discussion/68576/how-to-set-several-default-values-for-dropdown-select/
In addition you can refer below document,
https://success.outsystems.com/Documentation/How-to_Guides/Front-End/How_to_order_and_set_the_default_value_in_a_combo_box
Hope it helps you.
Regards,
Ajit Kurane.
It is reactive application. I am using drop-down widget.
Thank you for the help.
You are using dropdown. So defiantly, you also have some variable that is holding the dropdown selected value.
You just need to give default value of that variable..
Let suppose your local variable data type is entity identifier, so give
Entities.Animals.Dog
as default value.
If the data type of local variable is text. then default value will be "Dog".
Please check - Demo screen
Also check my attached OML.
Rahul
Hello Rahul, Thank you so much for your kind help. But can you please tell me how can I achieve the above outcome if my entity is not static. Because my your local variable data type is entity identifier, but the entity to which it is referred to is not static.
Thank you so much Rahul for the help.