In this article, you’ll learn how to add TrustedForm by ActiveProspect to your decision trees…
Learn more about meeting your TCPA compliance requirements using TrustedForm here:
https://activeprospect.com/products/trustedform/
- Copy/paste the trustedform script into the decision tree level, or global level script section.

- It should be above the </body> tag
- Note I have modified the field variable.
- So that it says “xxCertUrl”
IMPORTANT! YOU NEED TO EDIT THE CODE…
STEP 1: Add ‘//’ so it appears as…
//var field = ‘xxTrustedFormCertUrl’;
STEP 2: Add…
var field = ‘xxCertUrl’;
After your edit, your code should look like this…

2. Create a hidden custom field – “xxTrustedFormCertUrl”

3. Copy/paste this script into any node-level script section.
<script>
// starts a loop with interval of 500ms
var interval = setInterval(getCertUrl, 500)
function getCertUrl() {
var certUrl = document.getElementById('xxCertUrl_0').value
// check if the certificate has been generated
if (certUrl){
// assign the generated token to LH custom field
DT.setField('xxTrustedFormCertUrl', certUrl);
// logs the certificate to the console
console.log(certUrl);
// stops the loop
clearInterval(interval);
}
}
</script>
( Note that we want this to fire on enter )

4. Publish and access Decision Tree via the direct link to test.
- Turn on the browser console
- You will see once you reach the node that the Trusted Form Certificate URL will display on the console

5. Map / Email / Distribute this URL how you like.
- The URL will resolve to a valid certificate

Update:
Trusted Form has recently updated their script. If you are using the latest script from Trusted Form, please use this script in the node-level script section.
<script>
// starts a loop with interval of 500ms
var interval = setInterval(getCertUrl, 500)
function getCertUrl() {
var certUrl = document.getElementById('xxTrustedFormCertUrl_0') &&
document.getElementById('xxTrustedFormCertUrl_0').value;
// check if the certificate has been generated
if (certUrl){
// assign the generated token to LH custom field
DT.setField('xxTrustedFormCertUrl', certUrl);
// logs the certificate to the console
console.log(certUrl);
// stops the loop
clearInterval(interval);
}
}
</script>