Email Validation

Hi All,

How to validate an email address for users which are in same organization. If I am working in a abc organization and I want to validate that if users is not a part of an abc organization should show me invalid email address in textfield object in appian and if it is a valid user of that organization doesn't show me an error.

Example:

1. hdhdh@abc.com

2. xyz@abc.com

3. adrfer@abc.com

From above examples that users who is a part of abc organization then in textfield show me invalid email address. So my point is in one organization I need to validate users if it is valid no error should show in interface if it is not valid user then show me an error.

Please guide me how to achieve these in a!textfield() function under appian 22.2 version?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Hi Yash,

    you could use find() function, if it throws 0, then it is not in the text, if it throws any other position then it is correct. 

    Check the next example: 

    a!localVariables(
      local!value:"ashf@asd.com",
      local!value2: "ashf@abc.com",
      {
    a!textField(
      value: local!value,
      validations: if(find("@abc.com", local!value) <> 0,
      "",
      "not correct email"
      )
    ),
    a!textField(
      value: local!value2,
      validations: if(find("@abc.com", local!value2) <> 0,
      "",
      "not correct email"
      )
    ),
    }
    )

Reply
  • 0
    Certified Lead Developer

    Hi Yash,

    you could use find() function, if it throws 0, then it is not in the text, if it throws any other position then it is correct. 

    Check the next example: 

    a!localVariables(
      local!value:"ashf@asd.com",
      local!value2: "ashf@abc.com",
      {
    a!textField(
      value: local!value,
      validations: if(find("@abc.com", local!value) <> 0,
      "",
      "not correct email"
      )
    ),
    a!textField(
      value: local!value2,
      validations: if(find("@abc.com", local!value2) <> 0,
      "",
      "not correct email"
      )
    ),
    }
    )

Children
No Data