Custom action link in Contacts

maxmito
Member

Hello!

I tried to google and search in the existing posts but no luck so far: what I want to achieve is to customize the click action on a specific field, in my case the Phone Number one (or also a custom one in case possible): at the click I would like to trigger a JS postMessage action that would send the data in an iFrame I would have previously added using the CRM Extensions API, is this achievable?

CRM
0 Upvotes
5 Replies 5
dennisedson
Community Manager

@maxmito 

I do not believe you can customize anything outside of what you have in the iFrame.  Once you have an action that opens the iFrame, you then should have more control over the content as you own the app.

Thanks,

Dennis




Check out our Community Developer Blog
where we feature our Community driven developer podcast and how to content
0 Upvotes
maxmito
Member

Hi @dennisedson 
thanks for your answer, indeed the action I'm looking for is not only about opening an iFrame but also sending some data from Hubspot to the iFrame, to give you a full picture, we are exploring the possibility to integrate Twilio Flex (as iFrame in Hubspot) and from Hubspot tirgger voicecall (using Flex) by clicking the phone number on the Hubspot contact page.

0 Upvotes
dennisedson
Community Manager

If there is one person who would have some good feedback on this, it would be @Sean_Matthews

@Sean_Matthews , what are you thoughts on this?

Thanks,

Dennis




Check out our Community Developer Blog
where we feature our Community driven developer podcast and how to content
0 Upvotes
Sean_Matthews
Participant

Hey team,

 

So @maxmito, I'm 80% certain you can't do the "click phone number, automatically use the softphone" feature that you're looking for with CRM Extensions.

With the CRM Extensions, the closest you could probably get is creating a CRM Extension that's basically ONLY an IFRAME ACTION is the Primary Action. In that case, it would show up on the right side of the screen with a button labeled (presumably, something like) "Call with Twilio Flex".

As for your question, two things... first, you need to create an endpoint that returns JSON formatted correctly to display the card as you want (basically an empty results array with `primaryAction` set to IFRAME). Second, the platform gives you a few options for getting the data you're looking for. The "simplest" version here is to select the properties you'd like the platform to add to the GET requests they make on page-load. Here's a screenshot showing that config:
Screen Shot 2021-09-19 at 10.42.47 PM.png

 

Presumably you have control over the CRM Extension route that the platform is calling, and can do a little scripting to pop those properties out of the query parameters and append them however they need to be appended into the IFRAME url.

The second option is to make an API request using the ObjectId that's also automatically included in the GET request from the frontend. This one's a bit more onerous/intensive, but it may better suit your needs.

 

Does that make sense?

 

Hope it's helpful!

 

Best,

~Sean

0 Upvotes
maxmito
Member

Thanks @Sean_Matthews ,

indeed it doesn't look we can achieve what we wanted initially, Flex accepts standard postMessageses from other iFrame, and that would have been the best solution for a click to call solution, but in this case we have to look for alternatives.

0 Upvotes