Skip to main content
April 21, 2023
Question

is it possible to pass multiple email address in one textbox and validate

  • April 21, 2023
  • 13 replies
  • 0 views

in interface ,i  want a textbox in which i want to paste some mail addresses and then i need to validate those email address

    13 replies

    April 21, 2023

    Yes, but these emails must be separated by some delimiter.

    April 21, 2023

    a!localVariables(
      local!emails,
      local!invalidEmails: if(
        isnull(local!emails),
        {},
        joinarray(
          reject(
            isnull(_),
            a!forEach(
              items: split(local!emails, " "),
              expression: if(
                validateemailaddress(fv!item),
                null,
                fv!index
              )
            )
          ),
          ","
        )
      ),
      local!validation: if(
        isnull(local!invalidEmails),
        {},
        "Invalid email at " & local!invalidEmails & " position(s)"
      ),
      a!textField(
        label: "Enter emails",
        value: local!emails,
        saveInto: local!emails,
        validations: local!validation
      )
    )

    sabat0002Author
    April 21, 2023

    Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function 'split' [line 7]: A null parameter has been passed as parameter 1.

    Can you please help me with this