How to get custom attributes in framework JS file when an inbound call comes from embeddable client in salesforce

I tried following ways

added the following custom attributes as specified in the https://developer.mypurecloud.com/api/embeddable-framework/purecloud-embeddable-framework-example.html I have added similar way as specified in the below added image.

customInteractionAttributes: ["SFCaseID", "SFuserPhoneNumber"]

Then in this link https://github.com/MyPureCloud/embedded-crm-pef-example says that addCustomAttributes method should be included in listener.

below image framework.js file I have included the addCustomAttributes () method as specified in the document.

though i have added all necessary items, But its not triggering into it.

Also added below method which is provided in https://github.com/MyPureCloud/embedded-crm-pef-example/blob/master/public/framework.js
customInteractionAttributes: (() => {
console.log ('****Custom:'+window.location.search);
debugger;
let customAttributes = new URLSearchParams(window.location.search).get('customAttributes');

        if(!customAttributes) return [];

        return customAttributes.split(",");
    })(),

Is there any other setup has to be done ?

I am also looking into the OpenCTI documentation from salesforce

But this framework.js is not invoking it.

Can you let me know whats the missing step here ?

Hi Divya,

If your interactions have custom attributes that you're interested in and if you want to obtain those attributes, you specify those custom attribute names in the Framework.config.customInteractionAttributes.

Then, when you receive an interaction object (e.g., during screenPop, processCallLog, Interaction client event that you subscribed to, etc.), the interaction object has a property called attributes, and the custom attributes will be included in there.

As for integrating with Salesforce, if you are trying to embed the client inside Salesforce on your own, you may want to include their javascript library and use it to communicate with Salesforce page:
"https://developer.salesforce.com/docs/atlas.en-us.api_cti.meta/api_cti/sforce_api_cti_connecting.htm"

Please let me know if you have any questions.

Junji

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.