Save Validation Results - Flow Action

The Flow Action "Save validation results" lets you save the validation results of Plauti Verify's Apex and Screen Flow Actions.

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 save the validation results of Addresses, Emails, and Phone Numbers that were validated in a screen or apex flow. For the validating itself, see the Flow Action articles for Addresses, Emails, and Phone Numbers.

1 Fill in API Field Name and Assign Variable

  1. Open the Lightning Flow Builder.
  2. Make sure you have set up one or more Apex or Screen Flow actions for Address, Email and/or Phone as described in the other articles in this section.
  3. Open the Apex Action,
    or
    Open the Screen Action and click on each of the Plauti Verify components.
  4. At Field API Name, if it is empty, enter the Field API Name of the address, email or phone field that is mapped in Verify Setup > Object Configuration > Object > Address/Email/Phone tab.
  5. Check the Manually assign variables (advanced) checkbox.
  6. At Validation Result or Verify Validation Result, click in the "Search variables" field and select the variable you created earlier.
  7. If you added multiple actions or screen components, repeat the steps above for all actions and components where you want to save the results.

2 Store all validation results in a new variable

The validation results from the Plauti Verify - Validate Address, Email and Phone Action need to be stored in a variable, to serve as input for the "Plauti Verify - Save validation results" Action.

  1. Still in the Lightning Flow Builder, from the Elements section, drag a new Assignment to the screen from the toolbox on the left side.
  2. At Label, define a name for the assignment. If the API name is not set automatically, make sure an API name is defined as well.
  3. At Set Variable Values, click in the "Search variables" field and select + New Resource.
  4. At Resource Type, choose Variable.
  5. At API Name, define an API name for the new variable.
  6. At Data Type, choose Apex-Defined.
  7. At Apex Class, choose recordval__Rv2FlowValidationResult
  8. Tick the checkbox Allow multiple values (collection).
  9. Click Done.
  10. Change the Operator from Equal to Add.
  11. At Value, click in the "Search a field..." field and select the Apex Defined Variable you added in step 1 above.
  12. Click + Add Assignment if you want to store more apex defined variables:
    1. At Variable, enter the same Apex Defined Collection Variable as in the first row.
    2. Change the Operator from Equal to Add.
    3. At Value, enter the next Apex Defined Variable.
  13. Repeat step 2.12 until all Apex Defined Variables have been added.
  14. Click Done.

You have now stored the validation results of the fields you want to validate in a new variable that can serve as input for the "Plauti Verify - Save validation result" flow action.
Now would be a good time to also create/update a new record with the input from the Screen Component.

3 Apply the "Plauti Verify - Save validation results" flow action

  1. From the Elements section, drag a new Action to the screen from the Toolbox on the left side.
  2. In the New Action dialog, search for Plauti Verify - Save validation results and select it.
  3. 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.
  4. At RecordId, switch to "Search Resources" and fill in the variable of the created record.
  5. At ValidationResults, switch to "Search Resources" and fill in the Apex Defined Collection variable you created above.
  6. Click Done.

4 Connect your actions to the start trigger

Make sure the input Action or Screen component, Assignment, and "Save Validation Results" action are connected to the start trigger.

In this example, we're first gathering the field values in a screen. Values are then stored in a variable (assignment). A record is created and the variables from the assignment and the record Id are used as input for the "Save Validation Results" action.

5 Run the flow

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

In the example below a lead is created where the address, email, and phone number are validated and formatted upon entry. The First Name, Last Name, and Company are filled in as well in the flow.

When the flow is finished, the record is created, and the validation results are saved: