Skip to main content
October 5, 2021
Question

email id

  • October 5, 2021
  • 4 replies
  • 0 views

I have a form where a user needs to fill it. I have an email id field in it. So, now when a user enters the email I need to check whether the entered email id is already there in the records or not. If email id already presents it should throw an error in the interface saying "email id already exists".

Can anyone please let me know how to apply this scenario in my interface! 

    4 replies

    harshas2775
    Brainy
    October 5, 2021

    You can simply query your table, filtered based on the entered email Id. If any record is found (totalCount>0) then you can throw the validation. 

    E.G.

    a!localVariable(
    local!checkEmailID:a!refreshVariable(
    value:a!queryentity(
    entity:cons!EXAMPLE_YOUR_ENTITY,
    query:a!query(
    filter:a!queryfilter(
    field:"emailId",
    operator:"=",
    value:local!emailIdInput),
    pagingInfo:a!pagingInfo(1,1))),
    refreshonVarChange:local!emailIdInput),
    a!sectionlayout(
    contents:{
    a!textField(
    label:"Email ID",
    value:local!emailIdInput,
    saveInto:local!emailIdInput,
    validation:if(
    local!checkEmailID.totalCount>0,
    "Validation Message",
    "")
    )
    }
    )
    )

    October 6, 2021

    Thank you for your reply .

    But this method is not working. Can you / anyone suggest any other method

    mikes0011
    Brainy
    October 6, 2021

    When you say "not working", can you be more specific?  Are you getting a particular error?  What happens when you try?  Can you post the current version of your code and/or some screenshots?

    The Expression Guru