Validate Email - Apex Flow Action

The Flow Action "Validate Email" lets you validate an email address inside a flow. The validation results can be saved to a record with the Save validation results Flow Action.

Due to Salesforce Governor Limits, this Flow Action can only be used for processing single records. If multiple records are provided the flow will fail.

This article explains how to validate an email address in a flow. To save the validation results to a record afterwards, see article Save validation results.

1 Add the "Plauti Verify - Validate Email Address" action

  1. Open the Lightning Flow Builder.
  2. From the Elements section, drag a new Action to the screen from the Toolbox on the left side.
  3. In the 'New Action' dialog, search for Plauti Verify - Validate Email Address.
  4. At Label, define a name for your action. If the API name is not set automatically, make sure an API name is defined as well.

2 Fill in the input values

  1. At Email Address, switch to Search Resources and fill in the resource for the email addresses you want to validate. This can be a variable coming from a screen component or a record field.

  2. At FieldApiName, fill in the Email Field API Name that is mapped in Verify Setup > Object Configuration > Object > Email.

    This way the flow knows for which email field the email address should be validated.

  3. (Optional) At AutoProcessingScenarioName, fill in the name of an email auto processing scenario if you want the entered email to be automatically processed based on the validation result. When left blank, no auto processing is applied.

3 Assign the validation result to a variable

  1. Check the Manually assign variables (advanced) checkbox.
  2. At Validation Result, click in the "Search variables" field and choose + New Resource.
  3. At Resource Type, choose Variable.
  4. At API Name, define an API name for the new variable.
  5. At Data Type, choose Apex-Defined.
  6. At Apex Class, choose recordval__Rv2FlowValidationResult.
  7. Click Done.
  8. (Optional) At AutoProcessedEmail, assign a Text variable if you want to reuse the auto processed email address later in the flow, for example to store it on a record.
  9. Click Done.

The "Validation Result" variable holds the advice, status code, status message, and credit information for the validated email address. This variable can be added to an Apex-Defined Collection Variable and used as input for the "Plauti Verify - Save validation results" flow action.

4 Connect your action to the start trigger

Make sure the "Plauti Verify - Validate Email Address" action you just created is connected to the start trigger, together with any action that supplies the email address if applicable, and any follow-up actions such as "Plauti Verify - Save validation results".

5 Run the flow

Save the flow, give it a name and click Run.

When the flow runs, the entered email address is validated, and the validation result becomes available in the assigned variable for use in the rest of the flow.