Check if two inputs belong to the same record for verification
Application Type

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. If she does not and for instance, provides 222-2222, an error should be displayed. When this is verified, Customer Id should be automatically outfitted with her Id of 4. This field will be hidden in the actual form and be assigned on SaveOnClick. Is there a way to find out if two inputs belong to the same record?

Hi Tenisha,

On the save action, you can do the following filtering in your Customer entity to see if there are any matching records:

If a record is found, you can return the CustomerId coming from that filtered aggregate.

However, I'm not clear about what you want to achieve; if that user is already in the database, why/how do you want to "save" it into the DB again?

Also, to show an error about mismatch, I think you need to do it in a stepped manner; first you would get all the customers with the given FirstName, if any records are found, you would do another search in that subset with the given PhoneNumber. If no records found, you can show an error like "FirstName found but Phone doesn't match".


I don't really want to save it to the database again. I just thought it would be easier to make the form (I'm sorry, I'm new to OutSystems). What I want is a way to safeguard from human error. A Customer Rep will be inputting this information. If for instance it had a customer named Kadisha, I would not want the rep to mishear and enter Tenisha. So that's why I put the extra requirement to enter a phone number. That way the rep can realize they may have misheard before saving to the database.

I have changed a few things since. Instead I have used two dropdown search boxes. I thought this may be better so that when Anna is selected from the first box, 111-1111 is populated in the second drop down. However, I am getting some trouble with making this happen. Is this possible to do as they are from the same table?

Hi Tenisha,

so you have all customers already stored in the database right ?  I would guess that two customers will have same first name much more often then same phone number right ?  Phone number should be pretty much unique.

Why not ask customer phone number first, then present your rep with list of customers (first name/ last name / whatever you have in your db about customer that will further identify).  Very often there will only be one customer coming back with that phone number.  

Then your rep asks customer follow up information, such as the first name, in most cases to verify that correct phone number was given, in only a few cases to choose between more then one customer.  

If given name matches with an option in list, rep chooses option and you have your customer id to work with, if name doesn't match, then either wrong phone number was given or maybe customer needs to be added or ...


This is very true and moving forward I will definitely ask for the phone number. Is there a way to do this with the two dropdowns I have? Or is there an alternative way of bringing up this information?


How many customers are there, if not too many, retrieve them all from your database and use a dropdown search or something like that.

Ask you rep how he/she would like this to work.


There are hundreds of customers. The problem I am facing is getting the customer name dropdown to change when the number is selected from the phone number dropdown. I saw an example with Countries and States, however the phone number and name are from the same table.

Below shows what I'm trying to do. As you can see I need to have a handler for the onSelect event. However, I need to find a way to filter the aggregate on refresh.


Hi Tenisha,

I don't understand  why you would need 2 dropdowns to select one thing.  Once they search on phone number, you already have the customer, no need to have a separate widget to do another selection on name.  I don't see the point.  I mean, the only thing you want is that your rep is choosing the right customer.  I don't understand the concept of having 2 inputs.

So see attached oml for what I think would be more than enough for your purpose.  

Some things to note : 

  • the value should be mapped to customer id.  And then in the OnSelect, you can save that selected value in some local variable
  • I concatenated name and phone number in the Text attribute, so whatever your rep starts typing, either the name or the phone number, will work to narrow his/her search.



It's not really to select it, but for it to show up. I'll put a expression with the account number instead of the second dropdown then. I'm just trying to mitigate errors from going into the database like if the phone number told to the customer rep was 123-4566 and the rep misheard and selected 123-4567. 

Thank you for the oml. The addition of the selecteditem parameter would help. I appreciate your help greatly.

happy to help.

so for your understanding, I amended the oml to showcase actually doing something with the selection made in the dropdown search.


Also, judging by how you are struggling with this stuff, I can recommend the guided paths in the learning zone.



If you want to use filter with multiple conditions , you can use AND condition and also while displaying details in the detail screen you can remove ID attribute in the form, while saving the record you can filter the record based on Name AND PhoneNumber Get the Identifier for that filtered records update details accordingly.



Would this work with the changes I made? I have attached the File so you can better understand.


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