PandaDoc
Integrate PandaDoc into OneFocus as a Custom Activity to log status changes for your proposals. The integration requires Zapier, Lead Liaison API access, and access to OneFocus Custom Activities. This guide will walk you through the steps to set up the integration. Let’s get started!
Add a Custom Activity in OneFocus
Create a new Custom Activity in OneFocus by navigating to Setup > App Setup > Custom Activities > New
Configure your Custom Activity as shown below. Your activity fields may vary.
The Icon can be the PandaDoc logo that you keep inside your Media Manager.
The Custom Activity and fields will appear in OneFocus as shown below:
Configure your Zap
Have PandaDoc send a webhook to Zapier and Zapier catch the web hook:
Run JavaScript to parse the response. We provided sample JavaScript for you below.
var jsonArray = JSON.parse(inputData.data);
var outputData = [];
function number_format(number, decimals, dec_point, thousands_sep) {
var n = !isFinite(+number) ? 0 : +number,
prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
toFixedFix = function (n, prec) {
// Fix for IE parseFloat(0.55).toFixed(0) = 0;
var k = Math.pow(10, prec);
return Math.round(n * k) / k;
},
s = (prec ? toFixedFix(n, prec) : Math.round(n)).toString().split('.');
if (s[0].length > 3) {
s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
}
if ((s[1] || '').length < prec) {
s[1] = s[1] || '';
s[1] += new Array(prec - s[1].length + 1).join('0');
}
return s.join(dec);
}
jsonArray.forEach(function(item, index) {
var secondArray = item.data;
if (secondArray.status == "document.sent" || secondArray.status == "document.viewed" || secondArray.status == "document.paid" || secondArray.status == "document.completed") {
secondArray.recipients.forEach(function(recipient, index) {
if (recipient.email.indexOf("captello.com") === -1 && recipient.email.indexOf("leadliaison.com") === -1) {
var status = "";
if (secondArray.status == "document.viewed") { status = "Viewed"; }
if (secondArray.status == "document.sent") { status = "Sent"; }
if (secondArray.status == "document.paid") { status = "Paid"; }
if (secondArray.status == "document.completed") { status = "Completed"; }
var output_string = "{";
output_string = output_string + "\"email\":\"" + recipient.email + "\",";
output_string = output_string + "\"activity_identifier\":\"pandadoc__c\",";
output_string = output_string + "\"activity_info\":\"" + recipient.first_name + " " + recipient.last_name + " has interacted with PandaDoc\",\"activity_fields_data\":{";
output_string = output_string + "\"status__c\":\"" + status + "\",";
output_string = output_string + "\"name__c\":\"" + secondArray.name + "\",";
output_string = output_string + "\"grand_total__c\":\"$" + number_format(secondArray.grand_total.amount,0,'.',',') + "\",";
output_string = output_string + "\"created_by__c\":\"" + secondArray.created_by.first_name + " " + secondArray.created_by.last_name + "\",";
output_string = output_string + "\"recipients__c\":\"" + recipient.first_name + " " + recipient.last_name + " <" + recipient.email + ">\"}}";
outputData.push(output_string);
}
});
}
output = {outputData};
});
Send the parsed json to Lead Liaison’s API
Configure your PandaDoc
Set up your senders and recipients
Set up a webhook in PandaDoc to send to Zapier when a document status changes. Statuses can be filtered using the JavaScript added in Zapier.
Â
 Â
© 2021 Lead Liaison, LLC. All rights reserved.
13101 Preston Road Ste 110 – 159 Dallas, TX 75240 | T 888.895.3237 | F 630.566.8107 www.leadliaison.com | Privacy Policy