Blog

How To Use the Address Verification Flow Component (AVFC) Within an OmniScript

Overview

This article provides guidance on how to use the Address Verification Flow Component (AVFC) by ProvenWorks within an OmniScript.

How to include the Address Verification Flow Component in an OmniScript

Firstly, you will need to set up a development environment and link it to your Org. If you’re not familiar with this process, Salesforce have a great guide.

Open the command palette, and select SFDX: New Project, then SFDX: Create Lightning Web Component. We need this LWC to function as a wrapper around the Address Verification LWC, as we can’t directly implement a managed package within an OmniScript. Once the process has completed, navigate to force-app/main/default/lwc and find the newly created files for your LWC.

In the .js-meta.xml file, make sure isExposed is set to true, and runtimeNamespace is set to the namespace of the package containing your installation of OmniStudio. For example, here’s what ours looks like:

avfcWrapper.js-meta.xml

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<isExposed>true</isExposed>
<runtimeNamespace>vlocity_cmt</runtimeNamespace>
</LightningComponentBundle>

Next, copy and paste the following into your .html file. This is a template that includes the Address Verification LWC, so feel free to remove any fields that you do not specifically need or instead, change the existing fields to meet your requirements. For a full list of attributes that can be used with the component, see here.

avfcWrapper.html

<template>
<pw_avfc-address-verification-flow-base-component
use-county="true"
use-status="true"
countries="GB,US,CA"
origin="US"
country=""
state=""
postalcode=""
city=""
street=""
street2=""
county=""
status=""
onaddresschange={changeHandler}>
</pw_avfc-address-verification-flow-base-component>
</template>

Finally, we need to configure our LWC wrapper to listen to the events raised from the Address Verification component. This will allow us to read the address values from the component when the values change (i.e., a new verified address has been selected). I have given this method the name changeHandler in the above document, but you can use any name that you would like.

So that you can access the component’s values within the OmniScript, we must pass them to the OmniScript JSON Object. The event handler is passed the users input under the event.detail object, in easy-to-parse key-value pairs.

avfcWrapper.js

import { LightningElement } from 'lwc';
import { OmniscriptBaseMixin } from 'vlocity_cmt/omniscriptBaseMixin';

export default class avfcWrapper extends OmniscriptBaseMixin(LightningElement) {
address = {};
changeHandler(event) {
this.address = event.detail["address"];
this.omniApplyCallResp({"address": this.address});
}
}

You can, if necessary for your use case, manipulate the data in this method before calling this.omniApplyCallResp(), as this is what adds it to the OmniStudio JSON Object.

Adding the LWC into the OmniScript Editor

Under the build tab, drag the Custom Lightning Web Component into the step, and inside that component’s properties, set the LWC Component Override field to the name of the wrapper LWC that you created earlier. Click activate version, followed by preview to see it in action.

To check everything is set up correctly, click over to the Data JSON tab inside OmniStudio. The user’s address data should be populated, as in the screenshot below:

This JSON object is accessible by other OmniScript elements, allowing you to manipulate or re-use the address inputs.

Address Verification Flow Component Available Parameters

Value Parameters

street
street2
city
state
postal-code
country
county
status

Feature Parameters

inline-mode — Inline UI mode, more compact
use-county – Whether or not to use the county input
use-status – Whether or not to store a Verified/Not Verified attribute
use-second-street-line – Whether or not to use a 2nd line for the street input
return-company-in-street — Whether to return the company name registered at that address (if applicable)
disabled

Search Parameters

countries – A list of allowed countries
origin – The origin country of the request, will bias results towards the country the request originated from

Label Parameters – Customize labels for input fields

main-label
search-label
search-button-label
manual-button-label
street-label
street2-label
city-label
state-label
postal-code-label
country-label
county-label
status-label

Styling Parameters

additional-styles – Custom CSS to add to the component

Event Parameters

onaddresschange — Function to call upon the user changing the data in any field

How to: Automatically Populate the Primary County Field based on the entered ZIP Code

Note: Functionality for populating regional data based on a country entry is only available for AddressTools Premium, if you are using AddressTools Free then you can trial our AddressTools Premium application to take advantage of this feature plus many more that it includes. This guide only applies to United States of America based addresses.

What Does This Guide Achieve?

After following this guide, you will have successfully configured a field that automatically populates with the appropriate Primary County corresponding to the ZIP code entered. This example will use the Account object.

Creating the Necessary Lookup Fields

To begin, you will need to create the three necessary lookup fields:

  • Country Lookup
  • State Lookup
  • ZIP Code Lookup

To achieve this, follow this guide, ensure that you use the address block which you intend to implement this functionality on.

After creating these fields, you will need to enable the lookup field population:

  • Go to App Launcher | AddressTools Administration.
  • Select Settings from the sidebar.
  • Click the pencil next to Enable Field Lookup Population.
  • Tick the Enable Field Lookup Population checkbox.
  • Click Save.

Adding the lookup fields to the Address Block

  • Navigate to AddressTools Administration Page | Address Blocks
  • Select the Down arrow next to the relevant address blocks and click Edit
  • Under the Lookup Fields section, select the fields that you just created and click Save

Creating a Formula Field to Display the County

  • Navigate to Setup | Object Manager | [Object you are using]
  • Select Fields & Relationships | New
  • Select Formula and then Next
  • Name the field and choose the Return Type as Text then click Next
  • Select Advanced Formula then Insert Field
  • Select [Object you are using][ZipCode Lookup field that you created in the previous step]Primary County

Note: You will need to configure the Field-Level Security for this field and add it to your Page Layout to meet your desired criteria.

Now with the formula field created and on the page layout, when the record is saved with a valid USA based ZIP Code value, the value from the associated county record will now appear in the lookup field.

Contact Us

If you have any questions in relation to this article, contact us at: support@provenworks.com We will be happy to answer any questions or problems that you may have.

How to: Restrict which objects users can import to in SimpleImport

What does this feature do?
The Allowed Objects field ensures that users can only import to specified objects within Salesforce, as predefined by an administrator.

Note: This setting is specifically for the core SimpleImport user interface. The nature of the ManagedImport experience means that an object is predefined and cannot be changed, thus it is not affected by this setting.

How to enable this feature in SimpleImport

SimpleImport offers the capability to set separate settings at these different levels:

  • Default Organization Level
  • User 
  • Profile 

This can be achieved via Custom Settings in your Salesforce org:

  • Navigate to the Setup menu in your Salesforce org 
  • Under Custom Settings, select SimpleImport Settings 
  • Click on Manage to access the settings for SimpleImport. 

To edit the Default Organization Level Value: 

  • Click Edit
  • Enter the object API names that you would like to allow, ensure that these are separated by spaces
  • Save your changes.

To add a custom batch size for a User or Profile: 

  • Select “New”. 
  • Choose either “User” or “Profile”, then locate the desired one 
  • Enter the object API names that you would like to allow, ensure that these are separated by spaces
  • Save your changes.

Additional Note

The Allowed Objects field has a limit of 255 characters. If you hit this limit, there is an extension field Allowed Objects (Continued) which allows for another 255 characters.

The running user will be required to log out and back into Salesforce for the changed settings to apply.

If you would like to know more about SimpleImport and its features, refer to the SimpleImport documentation or user guide by clicking here

Contact Us

If you’ve followed this guide and still experience issues with your configured SimpleImport or ManagedImport, please reach out to our support team at support@provenworks.com. A member of our team will be happy to assist you. 

How to: enable ‘Undo on Error’ to achieve atomicity in SimpleImport

What does this feature do?
During an import, certain records may be prevented from being imported due to restrictions in your organization, such as validation rules. In this scenario, you may want to rollback the successful records to maintain atomicity of the job. Once enabled, the Auto Undo on Error feature will ensure that if any part of the import is unsuccessful, the entire import is reverted, adhering to the principle of atomicity.

How to enable this feature in SimpleImport

SimpleImport offers the capability to set separate settings at these different levels:

  • Default Organization Level
  • User 
  • Profile 

This can be achieved via Custom Settings in your Salesforce org:

  • Navigate to the Setup menu in your Salesforce org. 
  • Under Custom Settings, select SimpleImport Settings 
  • Click on Manage to access the settings for SimpleImport. 

To edit the Default Organization Level Value: 

  • Click Edit
  • Select the checkbox next to Auto Undo On Error
  • Save the changes to apply the updated settings.

To add a custom batch size for a User or Profile: 

  • Select “New”. 
  • Choose either “User” or “Profile”, then locate the desired one 
  • Select the checkbox next to Auto Undo On Error
  • Save the changes.

The running user will be required to log out and back into Salesforce for the changed settings to apply.

If you would like to know more about SimpleImport and its features, refer to the SimpleImport documentation or user guide by clicking here

Contact Us 

If you’ve followed this guide and still experience issues with your configured SimpleImport or ManagedImport, please reach out to our support team at support@provenworks.com. A member of our team will be happy to assist you. 

How to change the batch size in SimpleImport 

Overview 

This article provides guidance on how to change the batch size for imports in SimpleImport. 

Why change the batch size? 

To optimize resource usage and stay within Salesforce’s governor limits, it may be neccesary to reduce batch sizes for import jobs, particularly when importing into objects with extensive custom trigger or flow logic during insertion or update.

How to change the batch size in SimpleImport 

SimpleImport offers the capability to set distinct batch size values for different levels:

  • Default Organization Level
  • User 
  • Profile 

This can be achieved via Custom Settings in your Salesforce org. 

  • Navigate to the “Setup” menu in your Salesforce org. 
  • Under “Custom Settings,” select “SimpleImport Settings.” 
  • Click on “Manage” to access the settings for SimpleImport. 
  • To edit the Default Organization Level Value: 
  • Click “Edit“. 
  • In the editing interface, input your preferred batch size in the “Batch Size” option. This can be a value from 1 to 200. 
  • Save the changes to apply the updated batch size setting. 

To add a custom batch size for a User or Profile: 

  • Select “New”. 
  • Choose either “User” or “Profile”, then locate the candidate. 
  • Enter the batch size. This can be a value from 1 to 200. 
  • Save the changes. 

The running user will be required to log out and back into Salesforce for the batch size change to occur. 

If you would like to know more about SimpleImport and its features, refer to the SimpleImport documentation or user guide by clicking here

Contact Us 

If you’ve followed this guide and still experience issues with your configured SimpleImport or ManagedImport, please reach out to our support team at support@provenworks.com. A member of our team will be happy to assist you. 

How to: deploy SimpleImport and Managed Import to users in your organization

Overview

SimpleImport has three main implementation paths:

  1. SimpleImport (requires API Enabled) [Premium, Free]
  2. Managed Import with API Enabled (requires API Enabled)
  3. Managed Import with Apex Rest Services (requires Apex REST Services but not API Enabled)

Different paths require their own dedicated permissions which need to be assigned to the user/profile in Salesforce to leverage functionality. This article has been broken down to provide you with all the permissions required for your desired approach.

Why use permission sets?

A permission set is a collection of settings and permissions that give users access to various tools and functions. Permission sets extend users’ functional access without changing their profiles. This allows you to easily see what your users have access to as you are able to name the permission set.


Create a permission set

  1. From Setup, enter Permission Sets in the Quick Find box, then select Permission Sets.
  2. Click New.
  3. Enter your permission set name.
  4. Select the types of users for the permission set.

 

SimpleImport [Premium, Free]

Apex, Visualforce and Custom Settings

The user/profile will need access to all Apex Classes with the prefix:

  • pw_si__ [Premium]
  • pw_sifree__ [Free]

The user/profile will need access to the following Visualforce Pages:

  • pw_si__SimpleImport [Premium]
  • pw_sifree__SimpleImport [Free]

The user/profile will need access to the following Custom Setting Definitions:

  • SimpleImport Settings [Premium, Free]
  • Managed Import Settings [Premium]

Managed Import (with API Enabled or with Apex REST Services) [Premium Only]

Apex, Visualforce and Custom Settings

The user/profile will need access to all Apex Classes with the prefix:

  • pw_si__

The user/profile will need access to the following Visualforce Pages:

  • pw_si__SessionIdPage

The user/profile will need access to the following Custom Setting Definitions:

  • SimpleImport Settings
  • Managed Import Settings

License Allocation [Premium, Free]

After deployment to production, a license must be allocated to each user.

This can be managed in Setup | Installed Packages | Manage Licenses next to SimpleImport.

API Enabled or Apex REST Services? [Premium Only]

For Managed Import, if there is the option to use the solution with API Enabled, then this is recommended. For some implementations, API Enabled is not preferred, such as community implementations. For these cases, Apex REST Services must be enabled on the profile as the fall back option.

Contact Us

If you have followed this article and are still experiencing issues with configured SimpleImport or Managed Import, reach out to support@provenworks.com where a member of the team will be happy to assist.

How to: Provide access to our Address Verification Flow Component in a Digital Experience

Overview

With the Address Verification Flow Component now installed and in a Digital Experience, it is essential to provide access to CSP Trusted Sites to our component.

This article will explain what settings are required for users to be able to use AddressTools Verification Flow Component functionality.

Provide Access to our Component in Digital Experiences

  1. Salesforce Setup | navigate to CSP Trusted Sites
  2. Click Edit on https://addressvalidation.provenworks.com | Context "All"
  3. Click on Save.

Back to the Address Verification Flow Component installation walkthrough

How to: deploy Address Verification Flow Component to users in your organization

Overview

With Address Verification Flow Component now installed in your Org, it is essential to provide your users with the correct permissions to use the solution.

This article will explain what permissions are required for users to be able to use Address Verification Flow Component functionality.

It is recommended that a permission set is created for Address Verification Flow Component so that it can be applied to multiple users/profiles but these settings can be directly applied to the profiles.

Apex and Visualforce

The user/profile will need access to all Apex Classes with the prefix:

  • pw__avfc.

The user/profile will need access to the following Visualforce Pages:

  • pw__avfc.SessionIdPage

License Allocation

(Skip this step if you have been provided an Address Verification Flow Component Site License)

After deployment to production, a licenses must be allocated to each users.

This can be managed in Setup | Installed Packages | Manage Licenses next to Address Verification Flow Component.

 

Back to the Address Verification Flow Component installation walkthrough

Create a Contact with a Clean Address in a Salesforce Screen Flow

Introduction

Typeahead address searching in a CRM enhances efficiency by quickly suggesting relevant address options as the user types. This offers several benefits. Firstly, it results in reduced manual entry time and effort. It also improves data accuracy with up-to-date address databases and auto-completion that directly minimise errors. Lastly, it can also provide functionality to standardise addresses for consistency.

Key benefits:

  • Improved efficiency by suggesting relevant addresses as a user types.
  • Enhanced data accuracy through integration with up-to-date address databases and auto-completion.
  • Standardised addresses for consistency and easy analysis.
  • Intuitive searching for enhanced user experience and productivity.
  • Reduced manual entry time and effort.

What are Salesforce Flows?

Salesforce Flows give admins a chance to implement advanced processes into their Org with clicks, not code. Many additional components such as typeahead address entry have been designed by developers allowing anyone to implement and utilise such functionality with little technical knowledge.

To optimise the address entry process, we are going to look at the Address Verification Flow Component by ProvenWorks designed to verify address data at point of entry.

What are some of common use-cases for creating Contacts in a Flow?

There are so many use cases available – way too many to list here! Nevertheless, here are some key ones that can spark your imagination:

  • Service agents needing to create new Contacts at speed
  • Customers entering their information in an online checkout
  • New users registering their details to access a service

What is typeahead address search?

The typeahead address search allows users to start typing an address and a list of addresses will be presented associated with the text entered. Once a user clicks on an address in the list, the address will be populated into a familiar address fields format.

This is preferred to traditional address entry where users must individually enter the relevant address data in full into separate street, city, state, postal code and country fields.

What does this article cover?

We’ve established that a typeahead address search can improve user efficient and the quality of data, and we’ve also explored use cases where Salesforce Flows can optimise record entry in Salesforce. Now let’s combine the two and explore a common use case for Salesforce Flow Screens: Service agents capturing a Contact’s information where we’ll also implement typeahead address search to capture the address.

In this article, we’ll cover:

  • Creating a new Flow to create a new Contact
  • Utilising a Flow Screen to capture the Contact fields
  • Implementing typeahead address search functionality with the Address Verification Flow Component by ProvenWorks, and
  • Saving this information to a new Contact record.

Pre-requisites

Your Salesforce Org will require two managed packages available from the Salesforce AppExchange to obtain the typeahead address entry component.

It must be noted that these packages are paid for, with return on investment realised through improved staff efficiencies, reduced process abandonment, and better data quality.

💡  Do you have any questions before getting started? Contact us at support@provenworks.com.

 

Create a new Screen Flow

We’ll start by creating a new Salesforce Screen Flow and creating a new variable to store the Contact details being entered.

  • Go to Salesforce Setup | Flow
  • Select New Flow
  • Choose Screen Flow
  • Select Done
  • Add New Resource | Variable
  • API Name we used NewContact
  • Data Type | Record
  • Object | Contact
  • Select Save

 

Add a Screen to the Flow to capture the Contact’s information

Now we’ll introduce a Screen element to the Flow which will be responsible for capturing the Contact’s information. This information will be captured in dedicated fields that will eventually be saved to a new record.

  • Add Element | Screen
  • Name the Screen
  • Navigate to Fields (Next to Components) | Record Variable | NewContact
  • Drag the following fields onto the Screen:
    • First Name
    • Last Name
    • Email
    • Optionally add any additional fields that you need to capture, i.e. Mobile Number, but leave out the Address fields for now.
  • Navigate back to Components in the panel on the right of the Screen editor.
  • Add Address Verification by ProvenWorks into the Screen. 
  • Click on the Address Verification by ProvenWorks component to open the component parameters on the right of the interface.
  • Scroll down the parameters and tick Manually assign variables
  • Assign the following Values:
    • City Value > {!NewContact.MailingCity}
    • Country Value > {!NewContact.MailingCountry}
    • Postal Code Value > {!NewContact.MailingPostalCode}
    • State/Province Value > {!NewContact.MailingState}
    • Status Value > {!NewContact.pw_ccpro__MailingAddressStatus__c}
    • Street Value > {!NewContact.MailingStreet}
  • Click Done

 

Create the Contact Records

Now that we’ve completed a Flow Screen to capture the Contact’s information, we need to save it to a new Contact record in Salesforce.

  • Add Element | Create records
  • Name the Label
  • Create a Record from These Values | Record | NewContact
  • Click Done

 

Save the Flow

With a Flow now capable of capturing Contact information and saving it to a new Contact record, let’s save the Flow so we can utilise it in our Salesforce Org.

  • Select Save
  • Provide a Flow Label to help you identify the flow in the future, i.e. “Service Agent Contact Capture”
  • The Flow API Name will be auto populated, change this if required.
  • Click Save
  • Activate the flow

 

Copy the Flow’s URL

  • From Setup, enter in the Quick Find box, and then select Flows
  • Click the down arrow in the Flow we created, then click View Details and Versions
  • Copy the flow’s URL from the Flow Detail page

 

Incorporate the Flow into a Button

Buttons are a great way to distribute Flows to users in Salesforce. If you have a service agent taking calls, providing them an easy to access button to create a new contact can be a speedy way to get the job done with little hassle.

  • Go to Salesforce Setup | Contact | Buttons, Links, and Actions
  • Select New Button or Link
  • Label | Verify New Contact
  • Name | Verify_New_Contact
  • Display Type | List Button
  • Behaviour | Display in existing window with sidebar
  • Content Source | URL
  • Select Field Type | Contact
  • Paste the Flow’s URL link we copied earlier in the large text box like the example below (your link may differ as it is dependent on naming)
  • Click Save

 

Add the Button onto the List View Button Layout

  • Go to Salesforce Setup | Object Manager | Contact | List View Button Layout
  • List View Button Layout | Edit | Custom Buttons
  • Add the newly created custom button to Selected Buttons
  • Click Save

 

The Button will now be available in the Contact List View

 

 

Summary

And there you have it – our complete follow-along guide for creating a Screen Flow to enter a Contact record with a verified address!

We hope this article has given you the tools you need to set up your Salesforce CRM for better address data quality alongside a better use experience. If there’s anything you’re stuck on, or if you have any questions, please don’t hesitate to get in touch with us.

Contact us at support@provenworks.com

If you’re ready to get started with your own address data journey, why not jump on a kick off call with our team and let’s help you make the most of your Salesforce investment!

[Calendly – AddressTools]