How to Create a Link to the Pardot Lightning App Prospect in your Salesforce Leads and Contacts



The Pardot Lightning App was launched in 2018. As we begin 2022, why is the "Pardot URL" field still referring to the Pardot Classic app? And why do we have no off-the shelf internal reference in the Pardot Lightning App to the Pardot Prospect record in Lightning? I have no answer to these questions, but I have discovered an easy-to-implement solution to create a field for your Lead for Contacts that links to the equivalent Pardot prospect lightning record in the Pardot Lightning App. This solution is courtesy of Denise and Alexandre in the Trailblazer Community. It's too good not to share. [Update: this post has gone through three revisions based on the discovery of various iterations of Pardot IDs. I'm leaving in the 'extra' commentary as an example of the truism in marketing operations that many times our best processes are based on iterative improvements.]


The first thing you have to do is figure out how many digits your Pardot prospect ID's have (just roll over one on a list view, look at the URL and count is the easiest way), because it makes a difference to how this formula works. I've found Pardot instances where there are 9 digits, 8 digits, and 7 digits. I'm led to understand that there are possibly some instances where there are 8 or 7, and I've seen 9, which could mean 9 or 8. If if you have an extremely large database and you want to be absolutely sure, export your Pardot records and check the ID field in excel using the formula =LEN(cell id) to count the number of characters and see if they are all one value or if you have a mixture of lengths. [Before you go running off to do this-- know that the latest version of the formula does not rely on this information.]


Once you have that information, proceed to creating your custom salesforce field. You'll want to do this on both leads and contacts. It's a formula field with the output as text.


All you have to do is copy and paste this code as the formula, no substitutions necessary:


If you have 8 or (8 and 7) digit ID's use this code:

IF(NOT(ISBLANK(pi__url__c)),

HYPERLINK( LEFT($Api.Partner_Server_URL_260, FIND( '/services', $Api.Partner_Server_URL_260)) &'lightning/page/pardot/prospect?pardot__path=%2Fprospect%2Fread%2Fid%2F'& Right(pi__url__c ,IF(NOT(BEGINS(Right(pi__url__c ,8), '=')),8,7)),LEFT($Api.Partner_Server_URL_260, FIND( '/services', $Api.Partner_Server_URL_260)) &'lightning/page/pardot/prospect?pardot__path=%2Fprospect%2Fread%2Fid%2F'& Right(pi__url__c ,IF(NOT(BEGINS(Right(pi__url__c ,8), '=')),8,7)), "_self")

,"")



if you have 9 or (9 and 8) digit ID's, use this code: IF(NOT(ISBLANK(pi__url__c)),

HYPERLINK( LEFT($Api.Partner_Server_URL_260, FIND( '/services', $Api.Partner_Server_URL_260)) &'lightning/page/pardot/prospect?pardot__path=%2Fprospect%2Fread%2Fid%2F'& Right(pi__url__c ,IF(NOT(BEGINS(Right(pi__url__c ,9), '=')),9,8)),LEFT($Api.Partner_Server_URL_260, FIND( '/services', $Api.Partner_Server_URL_260)) &'lightning/page/pardot/prospect?pardot__path=%2Fprospect%2Fread%2Fid%2F'& Right(pi__url__c ,IF(NOT(BEGINS(Right(pi__url__c ,9), '=')),9,8)), "_self")

,"")


Each of the formulas above will render the correct link if the ID is either 9 or 8 digits or 8 or 7 digits.


Final Iteration of the formula. Alexandre Ruiz kindly updated it to work with ANY length of Pardot ID after the multiple lengths of ID issue was raised. So in the end, just use this one! 😊

IF( NOT(ISBLANK(pi__url__c)), HYPERLINK( LEFT($Api.Partner_Server_URL_260, FIND( '/services', $Api.Partner_Server_URL_260)) &'lightning/page/pardot/prospect?pardot__path=%2Fprospect%2Fread%2Fid%2F'& Right(pi__url__c ,value(text(LEN(pi__url__c) - FIND('=', pi__url__c)))) ,LEFT($Api.Partner_Server_URL_260, FIND( '/services', $Api.Partner_Server_URL_260)) &'lightning/page/pardot/prospect?pardot__path=%2Fprospect%2Fread%2Fid%2F'& Right(pi__url__c ,value(text(LEN(pi__url__c) - FIND('=', pi__url__c)))), "_self") ,"")


If there is a Pardot URL, this will parse out the prospect ID and construct a URL using your custom salesforce domain and render it as a clickable link. You can then substitute this for the Pardot URL field or use it alongside it. Clicking the link from the Lead or Contact record brings up the Pardot prospect in the Pardot Lightning app without leaving Salesforce (assuming that user has the proper permissions to see the record).


Happy New Year!


128 views
*As of April 2022, Pardot has been renamed Marketing Cloud Account Engagement, as part of Salesforce's effort to organize all the marketing products under the same platform umbrella. "MCAE" is simply the same Pardot we know and love under a new name. The product is temporarily being referred to as "Marketing Cloud Account Engagement powered by Pardot."   

Did you find this article useful?  Buy me a coffee. 🙂

Want more tips? Subscribe and be the first to know of new coffee-worthy content.

Thanks for Subscribing!