13
Views
6
Comments
Solved
Auto Populate Field B (Expression or any) when Dropdown A selected
Question
Application Type
Reactive

Good day, 

(My English is not good, understanding on my grammar and vocabulary mistake are appreciated)

My question is how to auto populate field B when select on a dropdown.

For example, I create an entity 'Task' and 2 static entities 'Priority' and 'Duration', When I select an option from the 'Duration' dropdown (1 month), then the duration will will auto populate as 'Low' priority; When I select option 1 week, the duration will be 'High'.

Any response are appreciated.

Thank you,

Regards.

Solution

Hi Joe Ng, 

I am sharing an OML file for your reference. It would be easy for you to understand from there.

Also, check this URL where I have implemented the same:

Task Logic

Hope this helps!

Regards,

Prakhar Sharma

Task.oml

Perfect!

Hi Prakhar Sharma,

Your solution solve the problem I face, thank you!

Good day ahead.

Regards,

Joe Ng

Hi Joe ng,

In priority expression, please follow this condition
If(DurationIdentifier=Entities.Duration.Month,"Low","High") 
or you have static Entity for priority
If(DurationIdentifier=Entities.Duration.Month,Entities.Priority.Low,Entities.Priority.High ) 
I attached the OML also please refer it, it  will help you .

regards
rajesh.

Test.oml

Hi Rajesh Venkat,

Thanks for your response, however its not works. The priority is static entity and have (example) 2 records, I need it changes based on the dropdown I selected such as when I select 1 month, then the (expression) will change to Low.

Anyway, this is a good reference for my study on Outsystems.


Thank you,

Regards,

Joe Ng.

Hi Joe Ng,

You need to create an OnChange for the Duration Dropdown. As soon as you select a value in the dropdown, set the desired priority in the OnChange action.

Eg: Lets Assume you have your Duration as 1 Month, 1 Week and 1 Day and your Priority as Low, Medium and High, then:

If you have selected 1 Month as duration (as given in the example), then in the OnChange, your condition needs to something like Priority = If(Duration = Entities.Duration.1Month, Entities.Priority.Low, If(Duration = Entities.Duration.1Week, Entities.Priority.Medium, Entities.Priority.High))

Hope this helps!

Regards,
Prakhar Sharma

Hi Prakhar Sharma,

Thanks for your response,


I am not sure in the OnChange, should I use If to set the condition?

I have 2 static entities(Priority and Duration), when I select on the dropdown option(GetTaskById.List.Current.Task.DurationId), for the expression what should I set inside the value?


I have no idea what should I set for the expression.


(Do you mean in the OnChange event, after I set the condition similar as the condition you suggest, the Priority will auto populate depends on the selected dropdown option? Hope I get your mean, if not please correct me. Thank you).


Thanks again for your response,

Good day ahead.

Regards,

Joe Ng.

Solution

Hi Joe Ng, 

I am sharing an OML file for your reference. It would be easy for you to understand from there.

Also, check this URL where I have implemented the same:

Task Logic

Hope this helps!

Regards,

Prakhar Sharma

Task.oml

Perfect!

Hi Prakhar Sharma,

Your solution solve the problem I face, thank you!

Good day ahead.

Regards,

Joe Ng

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