Are there good examples of what people are doing with crm integrations? Now that I have purecloud talking to dynamics, I am trying to understand how it is best to use it. Our first stab at this we want to do some lead data lookups on outbound campaigns. Right now we load all our leads into campaigns, I would like to retrieve lead info and display it on the outbound scripts.
I was able to use one of the canned actions, "Get Contact By Phone Number". I pass in a contact field Output.MobilePhone and it was able to reach out to Dynamics and set a variable "firstName" to the first name of the contact from the search. I trigger it by a button then have a text field that show the "firstName" variable.
I created a custom action "Get Lead Status By Lead ID" My hope is I can create a button or script load action that will take the crm lead id, which we load into our purecloud lists, outbound.id. When the script loads or the button is pushed, I am hoping to get the status of the lead. In CRM that is open, qualified or disqualified. Those values are represented by numbers, 0,1,2.
When I run the action test, I can pass in a LEAD_ID and it works. It spits out code like this in the "Flatten" section:
{
"lastname": "test1",
"companyname": "adsfasdf",
"firstname": "purecloudcallcount",
"statecode": 2,
"leadid": "3f0e7aff-08ce-e711-8118-e0071b715b91"
}
There is more to what it spits out but I omitted extra garbage.
This is my output contract:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Lead",
"description": "A Microsoft Dynamics 365 lead.",
"type": "object",
"required": [
"statecode"
],
"properties": {
"statecode": {
"type": "integer",
"description": "The numeric value of the state of the lead"
},
"leadid": {
"type": "string",
"description": "The lead id"
}
}
}
When I make a button that calls this action and tries assigning statecode to a Variable "stateCodeNumeric", when the script loads I get the following error:
FAILED TO LOAD SCRIPT
No Script Available: Message: Cannot read property 'toString' of undefined Status:
I am new to all of this so I know I am doing something wrong.
Any thoughts on my error I am getting and how these integrations and actions are intended to be used for outbound dialing? I hoped I could easily load a lot of the lead info into the script to get real time data loaded when making outbound dials on the leads.
Thanks