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.
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.
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
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
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
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.
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.
You should end up with a flow structure such as:
Step 2: Parameters
- Define a flow variable, for example params.
Warning: define it as a collection.
- Create a variable named targetField.
- Assign the record ID, the SObject name, and the field API name to it.
Complete step-by-step example: Screen Flow and invokable actions
Flow diagram for address validation
Step by step
- Create a Picklist Choice Set.
- Create a Screen Flow for the country picklist.
- Create the Address_Status variable to store the address quality code.
- 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.
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.
- Create the CityValue variable.
- 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.
- Create the assignment Reset Quality Code.
- Create the Type Record Object variable.
- Create the assignment Set Fields.
- Create a Create a record component.
- Create a decision named Check if address has status code.
- Create the params variable.
- Create the assignment Set API parameters.
- Call the invokable action.
Related to