Forum Discussion

ArletaMaæka_a's avatar
ArletaMaæka_a
Qrew Member
2 years ago

How to verify if list of emails has correct domain?

Hello,

I am working on an app where I set up a form where users provide different data. One field that I have is an email field called Notification Recipients. In this field users can provide multiple emails split with semicolon. For example: 'A.M@domain.com;A.M2@domain2.com;A.MM@domain.com'.  I'd like the form to be accepting only the emails that have '@domain.com' and for others to provide an error message and not allow the form to be submitted.

I tried to set up a formula field for that, but that failed for such list.

I will be grateful for any hints or suggestions on how to solve my problem.

------------------------------
Arleta Maæka³a
------------------------------

2 Replies

  • MarkShnier__You's avatar
    MarkShnier__You
    Qrew #1 Challenger
    try this
    var text EmailOne =   Part([Email String],1, ";");
    var text EmailTwo =   Part([Email String],2, ";");
    var text EmailThree = Part([Email String],3, ";");
    var text EmailFour =   Part([Email String],4, ";");
    var text EmailFive =   Part([Email String],5, ";");

    List("\n",
    IF(Trim($EmailOne) <>"" and not Ends($EmailOne, "@domaine"), "Bad " & $EmailOne),

    IF(Trim($EmailTwo) <>"" and not Ends($EmailTwo, "@domaine"), "Bad " & $EmailTwo),

    etc...

    IF(Trim($EmailFive) <>"" and not Ends($EmailFive, "@domaine"), "Bad " & $EmailFive))



    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
    • ArletaMaæka_a's avatar
      ArletaMaæka_a
      Qrew Member
      Thank you so much Mark for your help! It worked as expected.

      ------------------------------
      Arleta Maæka³a
      ------------------------------