jmkraap | 2020-05-04 13:55:49 UTC | #1
We have a flow which does the following with incoming calls:
1. Search for Salesforce contact with ANI (using data action). If Salesforce Contact is found, populate SF_Searchvalue and route to queue (flow ends here if contact is found)
2. If Contact is not found, jump to separate "Create contact" task
3. "Create contact" task creates new contact in Salesforce (using data action) with ANI as phone number and routes call back to original task ("Search for Salesforce contact").
The problem is that this creates a loop. Even though we have created a new contact in part 3 above, when flow is routed to part 1 again, search data action doesn't find the newly created contact and proceeds to create another new contact.
If we disconnect the call and place another call, the contact created by the data action in the previous call is found and everything works as it should.
Is this a bug? Why doesn't the data action find the newly created contact if it is created during the same interaction? How could we get this working? Without this functionality, calls to new contacts are not properly integrated between Genesys Cloud and Salesforce as there is no contact to link the call log task to in Salesforce.
I have also tried creating new contact in the same task as the search and doing search again, and also by routing the call to entirely different flow for creating the contact before routing call back to original flow, and the search fails to find the contact then as well. Only when the interaction is ended and new interaction is made, the contact search data action finds the newly created contact.
I have also tried to skip searching again and just populating SF_Searchvalue with ANI after creating the contact, but that doesn't work either (screenpop doesn't appear in Salesforce).
Jason_Mathison | 2020-05-04 14:03:29 UTC | #2
Hi Jani,
I don't think that this is a Data Actions issue as Data Actions don't have any concept of what workflow you are in, nor do they do any caching of results from Salesforce.
I believe that you are having this issue because there is a delay from the time you create a contact in Salesforce until you are reliably able to do a search for that contact. I can think of a couple of options.
The better option in my mind is that when you create a contact you could set the SFSearchValue participant data there, and then in the original task ("Search for Salesforce contact") you could check if SFSearchValue is set prior to calling the lookup by ANI Data Action.
You also might be able to resolve this by playing a few seconds of audio after creating the contact, but I don't know how many seconds it takes, and this approach will probably be much less reliable.
--Jason
jmkraap | 2020-05-04 14:30:05 UTC | #3
Hi, thank you for the reply! You are right - it takes some time for the contact to return results in the search data action. This seems to vary between 1 - 10 seconds based on couple of tests I just made. By playing audio prompt for 10 seconds, the integration works correctly.
The better option you suggested doesn't solve the issue however as far as I understand. If we just set the SF_SearchValue participant data and route the call directly to queue without delay, Salesforce isn't ready to show the search results based on that either unless we wait couple of seconds in the flow (by playing audio for example).
Is there any other way for handling interactions for new contacts in this integration? Making the customer wait in the queue for 10 extra seconds doesn't seem like a good solution.
If I have understood right, without doing this the way we have done it now, interactions for new contacts can't be found in Salesforce as the integration doesn't create the call log task at all then.
Jason_Mathison | 2020-05-04 14:59:34 UTC | #4
I guess you could create an audio file that lasts 1 second and includes a short beep in it. Play a short "please wait while we look up your information" message, then do a check for the contact / play the beep loop until the contact is available.
Playing a 10 second welcome to the queue message might also work, but does seem a bit excessive.
Richard.Schott | 2020-05-04 15:12:25 UTC | #5
What value are you putting for sfsearchValue? if you're using the ANI, then the SFDC platform hasn't had enough time to index all of the attributes of your newly created contact in order to be able to find it. You're better served using the object identifier as your sfsearchValue, which should be available almost immediately for screenpops, since it is both a unique value on the SFDC platform, and the primary index key for their search (this means it's indexed as soon as the object is created, and guaranteed to produce a single result from the search so the softphone settings should cause it to pop directly to the record).
Generally, I would discourage against your approach to re-route the call to original task to look up a contact by phone number. The successful execution of the data action to create the new contact already provides the data you need in order to proceed (namely the contact object you just created, complete with ID), so doing an additional lookup of this object is both a waste of time and prone to error. A better approach would be to have both the contact lookup and contact create tasks set the participant data, then have a third task that validates participant data is set prior to transferring to the queue; if the participant data is not set, then this 3rd past could transfer back to the lookup task (although you'll want to be careful of logical loops here).
With regards to the creation of the activity record, the PureCloud for Salesforce client will create an activity record for every connected conversation an agent handles. The only thing impacted by the delay in indexing (and therefore the failure of the screenpop to navigate to the expected record) is the association of that call log to the Salesforce object. In this scenario, the association can be manually updated by the agent after the call is connected by selecting the appropriate record in the dropdown menus on the call log view (or simply by navigating to the correct record if Auto Association is set in the call center configuration).
jmkraap | 2020-05-05 07:48:02 UTC | #6
Thank you! I was using ANI in SF_SearchValue. I now changed it to ContactID (which I get from creating the new contact earlier in the flow) and it works really well based on couple of tests. With it, new contact is found without delay.
We will need to change the flow logic to a better one so that loops are avoided in all cases as well. The way it was done now was mostly just to confirm we can get the use case implemented for the customer.
system | 2020-06-04 18:05:11 UTC | #7
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 7707