CRM Card Primary Action that Links to External page

Hello,

Wondering if there is a way to have the Primary Action button link to an external page, rather than open and iFrame (etc) when clicked.

It appears that other Apps (PSOHub) as an example, does this. Does anyone know what the JSON syntax for this is?

Hi, @thomp361 :waving_hand: Thanks for your question and for including your screenshot. I’d like to invite the community to the conversation — hey @Phil_Vallender @himanshurauthan @MatthiasKunz do you have any thoughts here?

@thomp361 is this the documentiaotn you are following? To make sure we’re on the same page — Accounts Dashboard | HubSpot

Thank you for taking a look! — Jaycee

Hi Jaycee,

Thanks for the response. Yes, that’s the documentation I am following.

I’d really appreciate some help on this!

Hello @thomp361

On the PrimaryAction object of CRM CARD, there is a key called URI, which takes the link to the internal page.

Gives an external page URL inside the internal page and returns done which closes the iframe popup.

e.g.

window.open(‘https://www.google.com/’, “__self”);

window.parent.postMessage(JSON.stringify({ “action”: “DONE” }), “*”);

We have tried it and it was working as Expected.

Hi @himanshurauthan

Thannks for the reply, however I am getting Response parsing error:

Invalid ValidatedUri: window.open('https://www.google.com/', "__self");

Can you please share a full json respone for this? Perhaps I am missing something.

You just have to add a Primary Action Uri in CRM card which contains a link to any internal HTML file. This HTML File must contain a script
window.open(‘https://www.youtube.com/’, “__self”);
window.parent.postMessage(JSON.stringify({ “action”: “DONE” }), “*”);

just add these 2 lines to the script
There is no need to send any Json Response from an HTML file.

This approach is not effective because most browsers will block the pop-up.

I’m also looking for an approach for that, would be great if you could use the primaryAction Button also just as a button to call an external link.