We do not use the automatic identification function to search for contact. Because we do not use the standard fields and our search is specific.
Our chatbot asks the customer for information such as first name, last name, email address, zip code, date of birth, etc.. The PVA calls a power automate which searches for the contact and sets the fields msdyn_customer and RegardingObjectId on the conversation filled with the found contact.
We then noticed that the contact is not yet linked on the Omichannel Agent form. I then found out that populating the fields is not enough, that you have to call the API "linkToConversation".
Is this the right way to do it? Or is there another way?
Description according to Microsoft:
https://learn.microsoft.com/de-de/dynamics365/customer-service/developer/reference/methods/linktoconversation
I added the javascript function to the form load, exactly the same as in the code example from Microsoft, you have to do a refresh afterwards so that it is also visible.
example from Microsoft:
//Linking an incident record with the current conversation
Microsoft.Omnichannel.linkToConversation("incident", "6b726d86-d37c-43b8-b3a4-c4056ddd2e07").then((response) => {
// Refreshing the tab UI
Microsoft.Apm.refreshTab("tab-id-3");
}, (error) => {
console.log(error);
});
Only this has the consequence that the refresh triggers the form load again and the linking happens a few times. How would you solve this?
The Power Automate also sets other custom fields on the entity conversation. If the conversation is loaded for the agent, the fields on the form are always empty. If I search for the conversation via Advanced Search and open the form, they are filled. Why is this not displayed in the agent form?
Thank you very much.