Customize the connector's behavior to suit your uses of Salesforce

When setting up your iAdvize app into your Salesforce environment, you can go further into the configuration and:
To set these options, you must have install the iAdvize package into your Salesforce organization. If you have not, go to the Salesforce app installation guide and start the implementation. 
 

You find these four options in Salesforce under the iAdvize Connector Configuration section (click on App Launcher, choose iAdvize and click on the Setup tab). Note that you must use a user profile with the "Advize - Administrator" permission to go to this section.

  • Then go to the Website Configuration part and click on the ⚙️(gear icon) of the website you want to personalize and click on Edit like below:
 
 
The panel below opens, this is where you can set these four options. 
 

 

1. Link the iAdvize Visitor object to the Salesforce object of your choice (Contact, Lead or Account)

This link activation allows:
  • your customer CRM profile to be available from the agent desk through the Salesforce object you linked to
  • you to access the Visitor object from the Salesforce object you linked to (Contact, Account or Lead)
  • you to access the Salesforce Contact, Account or Lead object from the iAdvize Visitor object

 

  • In Select Salesforce Object choose the Salesforce object to link

 

  • Then map at least one iAdvize fields with the Salesforce fields that matches it

 

⚠️ If you match the two iAdvize fields, please note that they are cumulative : the condition between these two rows is a logical "AND".
 

First example :  I want to map the iAdvize Visitor object on the Salesforce Lead object and perform this mapping on the email field. Here is the configuration:

 
ℹ️ Please note that the iAdvize Visitor email can be detected thanks to :
  • a custom data set on your site (cust_email) - Read more
  • a question from an iAdvize bot that populate the visitor_email variable - Read more
 

Second example : I want to map the iAdvize Visitor object on the Salesforce Contact object and perform this mapping if and only if the Visitor email field is equal to a Contact email field and if the Visitor external ID field is equal to a Contact Master Record ID field.

Here is the configuration:

 
ℹ️ In the example above, the iAdvize field "External Id" is the ID that you define for your Visitor through JavaScript Custom Data or through our API. We suppose that you use the Salesforce Master Record ID to define this External Id.
 

2. Add custom fields into the agent chat closing form to give more context to the conversation

To give more context to the conversation, your agents can add a comment in a custom field when they close the conversation. These custom fields will enrich the Conversation object like the example below:

  • To add up to four fields in the agent closing form, go to the Conversation’s closing options data, name them. You can make it a requirement by ticking the required option.
  • Then click on the toggle button at the end of the line and Save

 
This is how it looks like in the  agent closing form:

Capture_d_e_cran_2020-03-11_a__14.46.16.png

 


3. Activate your packaged flows (only available in package 2.0)

3.1. Introduction 

 

In the website configuration, there are four value lists that allow you to bypass the standard iAdvize behavior and use a flow to customize the behavior of the application.

Capture_d_e_cran_2022-10-17_a__11.20.41.png

 

 

These value lists allow you to select the Screen Flow that will be invoked to perform one of the following actions:

  • Create a record (Account, Contact, Lead or any other custom object) linked to the conversation from the Utility bar
  • Create a Case related to the conversation from the Utility bar
  • Search and select the record (Account, Contact, Lead or any other custom object) that will be linked to the conversation
  • The last value list allows you to select an auto-launch flow to automatically search and select the record to link to the conversation. This flow runs in back without human intervention and is intended for situations where the operator does not use the utility bar.

 

3.2. How to activate these flows

 

These flows should be created using the templates provided by iAdvize to be displayed in the value lists.

You can decide to use all four flows or activate only the ones you need. In order to use these flows, you will need to save each one of them as a new flow and then you need to activate them. Here are the steps to follow:

  • Go to Setup then click on Flow > All Flows

 

Capture_d_e_cran_2022-10-17_a__10.20.08.png

  • Look for the four flows that come with the package

Capture_d_e_cran_2022-10-17_a__10.20.45.png

 

  • Click on the first one. It will open a new tab with the flow details 

 

Capture_d_e_cran_2022-10-17_a__10.21.59.png

  • Click on Save As and name the flow with the label of your choice. We strongly advise you to keep the existing wording to make it simple. In the next example, I just added the word "connector": iAdvize connector-template Find and Select record. Once you fill in the label, the Flow API Name will automatically be filled in too. 

 

Capture_d_e_cran_2022-10-17_a__10.22.11.png

  • Save 
  • Make sure your newly created flow is activated
  • Repeat the operation for all four flows
  • Once you are done, go to the Setup section of the connector

Capture_d_e_cran_2022-10-17_a__17.07.08.png

 

  • Then, go to the Website Configuration section and click on the Gearwheel icon on the right side of the screen

Capture_d_e_cran_2022-10-17_a__17.08.14.png

 

  • Select each of the flow in each drop down menuCapture_d_e_cran_2022-10-17_a__11.20.41.png

You can now use the flows!

 

⚠️ These steps are mandatory if you want to be able to use the packaged flows in the setup section of the connector. 

 

3.3. Personalize the flows

 

The flows offered in the packaged are basic templates. In order to fit your needs, you can modify these flow templates accordingly. In order to do so, you need to save the template as a new flow (see step 3.2). 

 

3.3.1. Using a Screen Flow to create a recording related to the conversation

 


In the utility bar when none or more recordings are likely to be linked to the current conversation you have the possibility to create a recording:

 

Capture_d_e_cran_2022-10-19_a__14.53.36.png

This button displays the creation page of the type of object selected in your configuration, in this example a contact.
You can modify this behavior with a Screen flow. The advantage of this flow is that the input parameter is the visitor's information and the output parameter is the newly created record, thus making the link between the two.
To do this, you need to create a Flow using the Template : " iAdvize-template Create record ". 

 

Capture_d_e_cran_2022-10-19_a__14.56.40.png

The Visitor input variable contains all the visitor data provided by iAdvize. This variable will allow you to use this data to pre-fill the fields of the creation form as in the example included in the Template.

The output variables allow you to interact with the interface after closing the Screen Flow:

  • recordIdToAttach: the ID returned in this variable will be automatically linked to the current conversation.
  • recordIdToOpen : the record of the ID returned in this variable will be opened in the interface.

In the provided Template, we display a contact creation form pre-filled with the visitor's data, then we create a contact with the form data to finally assign to recordIdToAttache and recordIdToOpen the Id of the newly created record.

 

3.3.2. Using a Screen Flow to create a Case

 

In the utility bar when the conversation is linked to a record you have the possibility to create a Case.

 

mceclip0.png

This button displays the case creation page by injecting the Id of the conversation and the linked record if it is of type Account or Contact.
You can modify this behavior with a Screen Flow. This flow will have the advantage of having the visitor's information, the Conversation Id, Contact Id and Account Id as input parameters.
This flow will have to provide as output parameter the Id of the record to open after the flow
To do this, you need to create a Flow using the Template : " iAdvize-template Create Case ". 

 

Capture_d_e_cran_2022-10-19_a__15.01.35.png


Here is the list of input parameters available to create the Case:

  • Visitor: contains all the visitor data provided by iAdvize
  • ConversationId: contains the Id of the current conversation
  • AccountId: if the record linked to the conversation is an account, this field contains the Id of the record.
  • ContactId : if the record linked to the conversation is a contact, this field contains the Id of the record.
  • recordId : Id of the record linked to the conversation

The output variables allow to have interactions with the interface after closing the Screen Flow:

  • recordIdToOpen : The record of the ID returned in this variable will be opened in the interface.

In the provided Template, we display a Case creation form pre-filled with the visitor's data, then we create a Case with the form data to finally assign recordIdToOpen the ID of the newly created Case.

 

3.3.3. Using a Screen Flow to search and select a recording to link to the conversation

 

When a flow is set to search and select a recording to link to the conversation, a button is displayed and the automatic search for a recording is not done.

mceclip1.png

 

This button allows you to invoke a Screen flow that will be able to search and select a recording that will be linked to the conversation.
The advantage of this flow is that it will have the visitor's information as input parameter
The output parameter of this flow will be the Id of the record to link to the conversation
To do this, we need to create a flow using the Template: "iAdvize-template Find and Select record". 

 

 

Capture_d_e_cran_2022-10-19_a__15.27.31.png

 

The Visitor input variable contains all the visitor data provided by iAdvize, which will allow you to use this data to find the record that may correspond to the visitor.


The output variable to return is RecordIdToAttach, it should contain the Id of the record that will be linked to the current conversation.


The Screen Flow must then search for one or more records according to the visitor, then select visually through an interface or a selection strategy the record that will be linked to the conversation

 

In the template provided by iAdvize, the flow uses a subflow to search for a contact. The list of contacts found is then displayed to the user to choose one that will be returned to be linked to the conversation.


In order to maintain consistency the subflow used to search for contacts is the same as the flow used for non-interface registration searches.

 

3.3.4. Using an Auto-launch Flow to find a recording

 

When a conversation is opened, even if no operator is on Salesforce to process this conversation and link it to a recording, iAdvize will try to find the recording to link to the conversation automatically according to the iAdvize website/project settings.
You can modify this search with your own Flow auto-lauch:

To do this, you need to create a Flow using the Template: "iAdvize-template auto-launch Find records". 

Capture_d_e_cran_2022-10-19_a__15.31.36.png

 

The Visitor input variable contains all the visitor data provided by iAdvize.

 

The Context input variable contains all the context data of the conversation, including the channel and projectctId.

 

The output variable RecordIds should contain the Ids of the search results. Note that if several results are returned, none of them will be linked to the conversation automatically.
In the Template provided by iAdvize the search for contacts is done by email and the ids of the results are returned by the RecordIds return parameter.

 


4. Allow your agents to create a case when they close a conversation

This option gives your agents the possibility to create a Case on Salesforce through the agent closing form.

A new check box Create a case at conversation’s end will be displayed (see screenshot below). If your agents tick the checkbox, this checkbox will be automatically ticked in the Conversation object in Salesforce at the end of the conversation.

Then you have to create a flow with Salesforce to trigger the creation of a Case.

Capture_d_e_cran_2020-03-11_a__14.46.27.png

STEP 1: Display the checkbox to allow your agent to request a case creation

  • On the Conversation closing options data, you first must enable the option Create case like below:
 

When the agent ticks this checkbox to request the creation of a case, this checkbox will be ticked on the Conversation object:

 

STEP 2 - Create the Flow

Now that we have the information we need to create a Case at the end of the conversation, we have to create a flow that triggers when the Conversation object is created or updated.

 

  • Go to Setup then click on Flows > New Flow

Capture_d_e_cran_2022-11-22_a__10.11.38.png

 

  • Select "Record-Triggered Flow"
  • Click on Create
  • Name your Flow. In this example, we named it "Create Case at conversation's end"

 

Capture_d_e_cran_2022-11-21_a__11.51.48.png

  • Select object Conversation
  • Configure Trigger - select "A record is created or updated"

Capture_d_e_cran_2022-11-21_a__11.54.04.png

  • Set Entry Conditions: select "None"
  • Optimize the Flow for: select "Actions and Related Records"
  • Click on Done

Capture_d_e_cran_2022-11-21_a__11.54.12.png

 

  • Then, click on Add Element
  • Select "Decision"

Capture_d_e_cran_2022-11-21_a__11.54.27.png

  • Name the label "Is changed"
  • In the outcome details section, put "Yes" in the label field
  • Select "All Conditions Are Met (AND)"

 

Capture_d_e_cran_2022-11-21_a__11.55.01.png

  • Below, in the resources section, you will have two conditions to create
    • First condition:
      • select the resource "$Record> Create Case at Conversation's end"
      • for the Operator field, select "Is Changed"
      • set the value to True
    • Second condition:
      • select the resource "$Record> Create Case at Conversation's end"
      • for the Operator field, select "Equals"
      • set the value to True
  • When to Execute Outcome: select "if the conditions requirements are met
  • Click on Done

Capture_d_e_cran_2022-11-21_a__11.55.10.png

 

  • Then, click on Add Element after the "Yes" in the flow
  • Select "Create Record"

Capture_d_e_cran_2022-11-22_a__14.19.42.png

  • Name the new record "Create case" and add an appropriate description
  • Select "One" in the "How Many Records to Create" section
  • Select "Use separate resources, and literal values" in the "How to set the Record Fields" section

Capture_d_e_cran_2022-11-21_a__11.55.58.png

  • In the object field, select "Case"
  • In the section "Set Field Values for the Case", select "iAdvize__Conversation__c" in the field
  • In the value field, look for the Record ID and select it "$Record > Record ID"
  • Click on Done

Capture_d_e_cran_2022-11-21_a__11.56.06.png

Congratulations! Your flow is done. It should look like this: 

 

Capture_d_e_cran_2022-11-21_a__11.53.50.png

 

Make sure you save it and activate it in order to be able to use it. If you want to test it, you can do so by clicking on "Run". 

 

 

5. Choose to open automatically a case when a conversation starts

 

⚠️ This will be deprecated in the new package version 2.1. If you still want to automatically open a case when a conversation starts, you will need to create a flow within Salesforce that will allow you to do so. 

 

This option automatically opens a Case in a new tab in Salesforce when a conversation starts. Your users can add information to it while chatting with a visitor. They also have the choice to discard or save the case. 

Depending on your configuration and settings, the Conversation object will be attached to the case. If the Visitors are recognized and linked to a Contact or an Account object they will be attached to the case via one of these object.

  • To enable this option, turn on the toggle like below and Save
 

ℹ️ If you want to link the Conversation object to the Case, you need to add the field Conversation to your Case object layout. You can read this article to learn how to customize an existing layout.

 

From now, when a visitor starts a chat, a new tab will automatically open:

 

Your agents will be able to fill the Case form during the conversation: