Validate All - Apex Flow Action

The Apex Flow Action "Validate All" lets you validate all mapped and used fields (address, email, and phone) for a record in one go inside a flow.

Unlike the individual Validate Email, Validate Phone, and Validate Address actions, "Validate All" saves the results directly to the record. Any auto processed values (for example, a phone number reformatted from 06xxxxxx to +316xxxxxx) are saved immediately as well, provided the auto processing scenario is configured. The validation results remain available as output, so they can still be used for further processing later in the flow.

'Mapped' fields are the address, email and phone fields that are mapped in Verify Setup > Object Configuration > Object > Address/Email/Phone tab.

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.

1 Add the "Plauti Verify - Validate All" 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 All.
  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 Object for "SObject record" (input), select the Salesforce Object of the record you want to validate.
  2. At SObject record, fill in the record you want to validate. This can be a variable coming from a screen component or the record triggering the flow.
  3. (Optional) At Address Auto Processing Scenario Name, fill in the name of an address auto processing scenario if you want the address fields to be automatically processed based on the validation results. When left blank, no auto processing is applied.
  4. (Optional) At Email Auto Processing Scenario Name, fill in the name of an email auto processing scenario if you want the email field to be automatically processed based on the validation results. When left blank, no auto processing is applied.
  5. (Optional) At Phone Auto Processing Scenario Name, fill in the name of a phone auto processing scenario if you want the phone field to be automatically processed based on the validation results. When left blank, no auto processing is applied.

3 Assign the validation result to a variable

Because results, and if applicable the autoprocessed values, are saved to the record automatically, you do not need a separate Save validation results action for this Flow Action. However, the "Validation Result" variable is still available if you want to reuse the outcome later in the flow; for example, to branch the flow based on the validation advice.
To use the validation results further on in the flow, create a Validation Result variable for Address, Email, and/or Phone:

  1. Check the Manually assign variables (advanced) checkbox.
  2. At the Validation Results field of the type you want to use, e.g. 'Address validation results', 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. Repeat for the other types if needed.
  8. Click Done.

4 Connect your action to the start trigger

Make sure the "Plauti Verify - Validate All" action you just created is connected to the start trigger, together with any action that supplies the record if applicable, and any follow-up actions that use the validation result if applicable.

5 Run the flow

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

When the flow runs, all mapped and used fields for the record are validated and saved, including any auto processed values where applicable. The validation result becomes available in the assigned variable for use in the rest of the flow.