If element condition help

If element condition help

  
HI,
i´m new in the outsystems agile platform, currently i´m completing the online curses and in one hands on exercice i found a little exercice i couldnt resolve. This is the exercice:
i need a validation rule to prevent the creation of contacts if an existing email already is in the data base.
So i used this condition on the if element:

Index(EditRecord1.Record.Contact.Email, ) = -1

But i still miss the second argument, and after a tried some possible options i still dont do it rigth...
If anyone could help me would be great.

Simão Lopes
Hello Simao,

For you're assingment, you should use a query in the save action that get's all the contact. In this query you'll should use a condition that checks the inserted email (you can get it from the EditRecord) with the email that exist in the database.

After that you can use a if statement that looks if the number of contact(s) with the same email >0.

Hope this is enough for you to know with way you'll have to find the solution.

Regards,
Evert
Hello again Evert,

After reading your message I found the solution to the problem, it was really helpful. Thnks for your help! :)
Regards,
Simão