Page 1 of 1

Docusign and Processmaker

Posted: Sat May 11, 2019 12:50 pm
by skhaitan
Hi, I have integrated Docusign Embedded signing into Processmaker Portal (developed to use REST API) using iframe. So users are able to sign documents within an iframe and redirects to URL that says "Thank you for signing. ".
1.png
1.png (59.87 KiB) Viewed 1196 times
2.png
2.png (45.26 KiB) Viewed 1196 times
Below the iframe, there is a "continue after Signing" button. This should be disabled till the signing completes and enabled so that we can complete the task.

Or is there a way to auto complete the current task once the user is redirected to page "Thankyou for signing" so that the button can be removed ?



Please guide.

Re: Docusign and Processmaker

Posted: Mon May 13, 2019 11:33 pm
by amosbatto
This is really a question for DocuSign, so you should ask them.

Unfortunately, I don't have DocuSign, so I can't test this, but in theory you use a JavaScript polling function to check if the user has signed the document and then display the button. If you are displaying the DocuSign inside an iframe in a panel in your Dynaform, then you use your web browser's debugger to discover the ID of the "Continue after signing" button. Then you can use JavaScript to hide the button when the iframe's URL is loaded. Then, you can set up a polling function to check if the user has signed and redisplay the button.

I imagine that the code would be something like this:
Code: Select all
//hide button when iframe loads URL:
$('#yourFrameID').load(function() {
   $('#yourFrameID').contents().find('buttonID').hide();

   //polling function to check if user signed document and redisplay button:
   function checkIfSigned() {
     if ($('#yourFrameID').contents().find('*:contains("Thankyou for Signing the Document")').length > 0)) {
        $('#yourFrameID').contents().find('buttonID').show();
     }
   }
   setInterval(checkIfSigned, 2000); //execute every 2 seconds
});
Change yourFrameID to the ID of your iframe and buttonID to the ID that you find in the HTML code with the debugger.

Searching for text with contains() is inefficient and the text in the HTML has to be exactly "Thankyou for Signing the Document" for this to work, so it is better to see if DocuSign uses an ID or class that you can search for. Anyway, that gives you a rough idea where to start.

By the way, if you are client, have you asked the support team?

Re: Docusign and Processmaker

Posted: Tue May 14, 2019 4:28 am
by skhaitan
Hi, It worked.. Thanks a lot.

I did contact docu Sign but they said we can redirect to any external site. So i wanted a way to complete current task using external php program so that when it gets reirected, the task gets completed.. but your javascript solution worked perfectly as expected. Thankyou again!

Re: Docusign and Processmaker

Posted: Tue May 14, 2019 9:02 pm
by amosbatto
Glad that it worked. Can you post the exact code that you used?
I want to put it on the pmusers.com wiki.

Re: Docusign and Processmaker

Posted: Fri Jul 12, 2019 4:07 pm
by PipSqueak
skhaitan wrote: Tue May 14, 2019 4:28 am Hi, It worked.. Thanks a lot.

I did contact docu Sign but they said we can redirect to any external site. So i wanted a way to complete current task using external php program so that when it gets reirected, the task gets completed.. but your javascript solution worked perfectly as expected. Thankyou again!
Hi skhaitan,

Just out of curiosity, are you using the docusign API plan?

Thanks