Change dropdown search options after selecting value from other dropdown search
Application Type
Reactive

I have a form that will be filled over counter by a rep. The customer will provide a first name and phone number in order to verify that this customer is who they say they are. The information that they provide for input should match a customer record in the customer table. For instance, Anna should provide her first name along with phone number 111-1111. 

I would like to find a way to change the customer name dropdown to change when the number is selected from the phone number dropdown. I know I need to have a handler for the onSelect event. However, I need to find a way to filter the aggregate on refresh. I saw an example with Countries and States, however the phone number and name are from the same table and I think that changes things slightly. Is there a filter that can help me with this?




Test.oml

Hi Tenisha,

you can create a boolean local variable that controls the filter you want to apply in the aggregate.

When the variable is activated on the onSelect event, you can refresh the query and the filter is applied.

Regards

Hey,

To achieve what you expected , I will suggest to bind 2 local variable with dropdown widget. After that onSelect refresh aggregate. That aggregate should contain filter like below.

suppose 1.localName 2.localPhone these are 2 local variable bind to widget.

localName=nulltextIdentifier or customerentity.name like "%"+localName+"%"

based upon this filter your result will get generated.

Hi Tenisha, 

You can create a second agregate of the Customer Entity and bind it to the Names.

You can set as a filter: Costumernumber = "" or Costumernumber = CostumerEntity.Number

You'll then have to refresh this agregate on the On Change of the Number Input.

This will have your costumer entity only show names of people whose phone number is equal to the number you have written on the above screen. You can also try  Costumernumber like "%" +  CostumerEntity.Number + "%" if you want to, for example, write "111" in the number and the name dropdown would have all names whose numbers contained "111".

If you end up trying this approach let me know. It might not be the best one since you're using two aggregates to get similar information but I feel it is the easiest approach.


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