I'll get you started on the script and where you can go to get the education to do a lot of the work. I can then help you with troubleshooting your script.
- Get the sample button code that DocuSign provides here:
- Save this via a text/code editor in your personal code repository as a .js file.
- Login to DocuSign and navigate to your Template to get the Template ID:
- Copy this Template ID
- Open your sample button code in your text/code editor and search for the following: DST = '';
- Enter a new line before this text so that it is now on its own line
- Paste your Template ID
- Save your file. You now have the Template ID to reference during your sending
As to the conditional logic, you can learn about JavaScript conditional logic here: https://www.w3schools.com/js/js_if_else.asp
You can read about how to reference Salesforce objects and fields here: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_access.htm#!
You'll also need to map Salesforce fields to DocuSign Merge Fields for Salesforce. You can read about how to do this here: https://support.docusign.com/guides/dfs-user-guide-create-merge-fields-user
You can read about how to add these new Merge Fields to your Template here:
Once you have these steps completed and have a button script, post it here and I'll help you further.
Good luck and talk again soon.
Take care,
Arash Sayadi