Install the SalesForce Screen Flow package from here.
After installation, first make sure that you have entered your credentials for the AFD API. You can do this by selecting ‘Setup’ from the top right-hand corner and then going to ‘Custom Code’ > ‘Custom Settings’.
Next to Address Config, click on ‘Manage’ then under ‘Default Organization Level Value’, click on ‘Create New View’.
Choose an appropriate name and then select Serial, Password, and Maximum Response from the Available Fields. Maximum response is how many results you want to appear when searching for an address. It should appear as follows once set:
After you have setup your credentials, you need to ensure that you have updated/imported the country list into the AFD Countries Object.
To do this, go via the App Launcher and select ‘View All’ – scroll to ‘All Items’ and choose ‘AFD Countries’. Select the import option. An example CSV file can be downloaded here.
Continue to the next page to import. Once imported, go back to the Countries page, and select the setup option – ‘Select Fields to display’ to display the imported country fields.
Within the flow build, when editing your screen, add the Address Finder (AFD Validation) component from the components list from within the custom section.
The address Finder component should appear as follows:
Set the properties of the component to define the address fields to be displayed. The address component properties will generate the address fields. If you have existing address fields within your screen, you will need to replace them with the component field settings for interaction with the lookup.
Set the Default Country to the 3-character ISO code (e.g., GBR). This will default the country component to UK addresses.
The fields that are returned by a Lookup are either Standard or International. Set the AFD Field Type to one of these. The different types determine the fields returned.
In addition, set the AFD Password and AFD Serial field setting.
There are 3 sets of field properties. The AFD Field to map, The Label for the Output, and the Output Value.
AFD Field to Map – set this to the field value returned from the lookup. For example, setting to Address1:
Set the label that will be displayed for this field at the corresponding ‘Label for Output’ . For example, ‘Address Line 1’:
The Output value fields are what you will use when assigning the field values to your object via the create records element.
When viewing your screen flow page, it should appear as follows, when set with the examples above:
You can specify the Helptext for a field which will be displayed as a tooltip.
To mark fields as Mandatory add {!$GlobalConstant.True}
to the chosen “Required Output line” field.
To ensure this works correctly, it is required that you have already updated/imported the country list into the AFD Countries Object. Within the flow build, the properties of the component to define the phone fields will be displayed like the below:
To ensure this works correctly, it is required that you have already updated/imported the country list into the AFD Countries Object. Within the flow build, the properties of the component to define the phone fields will be displayed like the below:
All API Calls will be stored in an object called AFD API Logs: