Discussions

 View Only
  • 1.  How to verify if list of emails has correct domain?

    Posted 06-21-2022 09:43
    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.  RE: How to verify if list of emails has correct domain?

    Posted 06-21-2022 09:52
    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
    ------------------------------



  • 3.  RE: How to verify if list of emails has correct domain?

    Posted 06-22-2022 07:58
    Thank you so much Mark for your help! It worked as expected.

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