Salesforce - Set up DataQ Screen Flow

Support DQE
Support DQE
  • Updated

Screen Flow components

Starting with version 1.45, DQE One for Salesforce provides a set of Aura components specifically designed for use within Screen Flows.

These components implement real-time API calls for the validation of postal addresses, email addresses, and phone numbers.

From a usage perspective, they behave like standard Flow field components and are available in the Custom section of the Flow component palette.

Standard components

Add these components to your Screen Flow in the same way as standard input fields, then bind their output values to Flow variables in order to retrieve the required information.

Component in Flow Screen

Address Lookup

Attributes:

  • API Name: unique identifier among the Flow variables
  • Label: displayed label above the field
  • Street Value: output variable for Street
  • City Value: output variable for City
  • Country Value: output variable for Country
  • Country Options: JSON-formatted list of options, for example: [{'label': 'United States', 'value': 'US'}]
  • Postal Code Value: output variable for Postal Code
  • State or Province Value: output variable for State
  • Latitude Value: output variable for Latitude
  • Longitude Value: output variable for Longitude
  • Status Code: API status code after validation
  • Disabled: prevents manual updates in the input field
  • Required: displays the field as required
DQE Address field
Latitude and longitude fields

Inherited global settings from DQE Address Setup custom settings:

  • Default Country
  • Autofill Address Complement: whether to insert additional address information in the street field
  • Autofill Geolocation Info: inserts latitude and longitude values

Email Lookup

Attributes:

  • API Name: unique identifier among the Flow variables
  • Label: displayed label above the field
  • StatusCode: API status code after validation
  • Value: input value
  • Placeholder Text: displayed inside the input field if empty
  • Required: sets the required icon beside the input field
  • Disabled: prevents manual input in the field
DQE Email field

Inherited global settings from DQE Email Setup custom settings:

  • Suggest Username: suggestion only applies to the email domain
  • Code: Blacklisted Domain
  • Code: Domain Throwable
  • Code: Inbox Full
  • Code: Invalid Email
  • Code: Syntax Error
  • Code: Unauthorized Username
  • Code: Unknown Domain
  • Code: User Not Verified
  • Code: Valid Email
  • Accept Extended Syntax

Phone Lookup

Attributes:

  • API Name: unique identifier among the Flow variables
  • Label: displayed label above the field
  • StatusCode: API status code after validation
  • Value: input value
  • Country Code: country ISO code (ISO-2)
  • Placeholder Text: displayed inside the input field if empty
  • Required: sets the required icon beside the input field
  • Disabled: prevents manual input in the field
DQE Phone fields
Country code phone field

Inherited global settings from DQE Phone Setup custom settings:

  • Display Country Selector
  • Code: Phone is Invalid
  • Code: Phone is Valid
  • Output Format

Flow invokable actions

All these invokable actions must be executed asynchronously, as they perform callouts to the DQE APIs.

As a result, each call must be executed in a separate transaction. Otherwise, you will encounter an exception indicating that pending work still exists and the callout cannot be performed.

Once the response is received, the status code is stored in the field mapped in the corresponding custom setting, in the same way as when using a DQE Form component to create or update a record.

Requirements

The following list outlines general requirements and recommendations from Salesforce documentation regarding invokable actions and their usage.

Salesforce requirements screenshot

Postal Address Validation

This Apex invokable class can be used to validate a postal address.
Associated custom setting: DQE Address Setup

Parameters

Type: List<String>

Parameters:

  • RecordId (String): record ID
  • FieldNameAPI (String): address field name

Example:

For an Account record: ("001KG00000Mi2khYAB", "BillingAddress")

Email Validation

This Apex invokable class can be used to verify an email address.
Associated custom setting: DQE Email Setup

Parameters

Type: List<String>

Parameters:

  • RecordId (String): record ID
  • FieldNameAPI (String): email field name

Example:

For a Lead record: ("00QKG000001RLeL2AW", "Email")

Phone Validation

This Apex invokable class can be used to verify a phone number.
Associated custom setting: DQE Phone Setup

Parameters

Type: List<String>

Parameters:

  • RecordId (String): record ID
  • FieldNameAPI (String): phone field name
  • CountryCode (String): country code (ISO2 or ISO3) to use for the search

Example:

For an Account record: ("001KG00000Mi2khYAB", "Phone", "USA")

Step-by-step example

Step 1: Record-Triggered Flow definition

  • Select the SObject.
  • Select the triggering event.
  • Select the Actions and Related Records optimization.
  • Create a scheduled path. This is required because of the callout performed by the Apex action.
Record-triggered Flow configuration

You should end up with a flow structure such as:

Final Flow structure

Step 2: Parameters

  1. Define a flow variable, for example params.
Define Flow variable

Warning: define it as a collection.

  1. Create a variable named targetField.
  2. Assign the record ID, the SObject name, and the field API name to it.
Set parameters

Complete step-by-step example: Screen Flow and invokable actions

Flow diagram for address validation

Flow diagram
Flow diagram component

Step by step

  1. Create a Picklist Choice Set.
Picklist Choice Set
  1. Create a Screen Flow for the country picklist.
Picklist Screen Flow
Picklist Screen Flow configuration
  1. Create the Address_Status variable to store the address quality code.
Address_Status variable
  1. Create a Screen Flow where you can display all the fields needed to create your future record.
    In this scenario, the DQE Address Check invokable action is also used after the record is created.
Address Screen Flow

Data binding:
The key idea is to map the attributes of the DQE Address Field component to the standard Address field. In this example, they are labelled as:

  • DQE_Address
  • AddressField

This results in the following mapping.

DQE Address mapping
Address field mapping
  1. Create the CityValue variable.
CityValue variable
  1. Create Check Manual Input.

Even if the mapping made at the previous step seems to be bidirectional, a manual update in the AddressField component will not update the value in the DQE_Address component.

This allows you to check whether a manual input occurred after DQE completed the information.

Check if manually changed
  1. Create the assignment Reset Quality Code.
Reset Quality Code assignment
  1. Create the Type Record Object variable.
New Lead creation
  1. Create the assignment Set Fields.
Create assignment
  1. Create a Create a record component.
Create records component
  1. Create a decision named Check if address has status code.
Create decision
  1. Create the params variable.
params variable
  1. Create the assignment Set API parameters.
Set API parameters
  1. Call the invokable action.
Invokable action

Related to

Was this article helpful?

0 out of 0 found this helpful