Flowscreen 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
- Street Value: Output variable for Street
- City Value: Output variable for City
- Country Value: Output Variable for Country
- Postal Code Value: Output variable for Postal Code
- State or Province Value : Output variable for State
- Status Code : API status code after validation
- Disabled: Prevent manual update in the input field
- Required: Display the field as required
Email Lookup
Attributes:
- API Name : Unique identifier among the Flow variables
- Label : Displayed label above field
- StatusCode : API status code after validation
- Value : Input Value
- Placeholder Text : Displayed inside the input field if empty
- Required : Set the required icon beside input field
- Disabled : Prevent manual input in the field
Phone Lookup
Attributes:
- API Name : Unique identifier among the Flow variables
- Label : Displayed label above field
- StatusCode : API status code after validation
- Value : Input Value
- Placeholder Text : Displayed inside the input field if empty
- Required : Set the required icon beside input field
- Disabled : Prevent manual input in the field
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>
Params:
- RecordId (String) : record Ids
- FieldNameAPI (String) : The 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>
Params:
- RecordId (String): the records Ids
- FieldNameAPI (String) : The Email Field name
Example:
For an 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>
Params:
- RecordId (String): the records Ids
- FieldNameAPI (String) : The Phone Field name
- CountryCode (String) : the country code (ISO2 or ISO3) to search on
Example:
For an Account record - (“001KG00000Mi2khYAB“, “Phone“, “USA”)Step by step example
STEP 1: Record-Triggered Flow Definition
- Select the SObject
- Select the event triggering
- Select the [Action and Related Records] optimization
- Create a scheduled Path (doesn't work otherwise 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")
/!\ Take care to define it as a collection.
- Create a variable named targetField
- Assign values to it being: The record Id, the Sobject Name and the field's API Name
Step by Step complete example flowscreen and invokable actions
Flow Diagram for Address Validation
Step by Step
- Create a Picklist Choice set
- Create a screenflow for the country picklist
- Create the variable Address_Status (store the address quality code)
- Create a screenflow : Where you can display all the fields you need to create your future record.
In this scenario we even used the DQE Address Check Invokable Action (described next chapter) after the record is created.
Data Binding :
The key idea here is to make a mapping between the attributes of the DQE Address Field Component and the Standard Address Field. In this Example they are respectively labelled as:
- DQE_Address
- AddressField
So we endup with the following mapping.
- Create the variable CityValue
- Create Check Manual Input
Even if the mapping we 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 after the form filling if there have been a manual input after DQE completed the informations.
- Create assignment "Reset Quality Code"
- Create variable Type Record Object
- Create assigment "Set Fields"
- Create a component "Create a record"
- Create a decision "Check If address has status code"
- Create variable "params"
- Create assigment "Set API parameters"
- Call invokable action
Related to