How to select a default option from dropdown/radio button?

for example, if there are some scenarios where we have to show an option selected by default from Radio Button/Dropdown to the user then how should we implement that.

Hi @Vishal, Currently we don’t have this functionality where we have to show an option selected by default from any LOV elements to the user.

Hi @Vishal, thanks for posting to the Vahana Community.

This is very easy to achieve. I will share the step by step instructions below.

Step 1: Have the Dropdown/Radio Button Group Ready
In this case, I have taken a dropdown but you can do this on Radio Button Group using the same steps as follows.
image

Step 2: Map it to LOV Enumeration/Data Store
In this case we have used an enumeration.

Step 3: Make a note of the default value you are going to map to the Dropdown/Radio Group
In case if the values are coming from API, you can note the respective code/key reference in front of the value which you have to display.
In this case, I have chosen “French” to be my default selection therefore the key for the same is “french”.

Step 4: Create the task
This is the most crucial step so please do it carefully. Use the “copydata” task on “OnPageCreate” event on the page you want to display the default value and pass the key of the default value as STATIC and on the other side of the copy data select the dropdown/radio button group element.

Please do not forget to put the same element in “Reload Element” section of the “Copy Data” task.

Conclusion: You will see the default value pre-selected on the build
image

That’s all… Thanks!

2 Likes