Solved

Conditional Formatting - Salesforce/Conga Composer/Docusign Integration


Userlevel 4
Badge +6

I can't seem to get an answer from Conga or Docusign on this - so hopefully the community will help!

We are sending a DS document that is sent via Conga Composer in Salesforce. Is there a way to add conditional formatting to the document (for example: make a field required if another field equals "yes")?

I know this works if you send the document directly from DocuSign, but we are sending it via a Conga button in Salesforce using the Docusign Parameters... Thoughts???

icon

Best answer by Community Expert 9 April 2019, 23:06

View Original

15 replies

Userlevel 2

I'm unfamiliar with Conga to give an exact answer.

However, I believe Conga Composer takes advantage of JavaScript / APEX. Assuming that's correct, you'll have to use a conditional statement in your button code (if/then statement) to determine whether the object referenced is checked (true). If so, then you can enable what you have in mind.

With that said, I'm a bit unclear on one point. When you wrote "conditional formatting" do you mean changing font, color, size or do you mean conditionally making certain fields available?

If it's the latter, let me know the specific field logic you want to use and whether, once conditional fields are enabled, the signer can switch out of it (uncheck the condition that makes certain fields appear/required).

Depending on your answer, I can share one of the solutions I've used with my customers that may work for you.

I'm happy to help further once I know more.

Take care,

Arash Sayadi

 

Userlevel 2

Hi,

Thanks for reaching out. I've not well versed in Javascript so I utilized Conga instead to make the button to send the DocuSign document. I am actually trying to create a "Send with DocuSign" button on my custom object now since I believe this then will allow for conditional formatting since the template is being pulled from DocuSign's website versus Conga creating the document.

You wouldn't know how to create the button or necessary components would you? I've tried reading the documentation and reached out to Support (got no where with them), but I'm still not too keen on this.

Userlevel 2

 

I've created some custom buttons in the past. If you want to upload your script and highlight where you're trying to make the conditional selection, I'm happy to help you troubleshoot it.

  

Take care,

Arash Sayadi

 

Userlevel 2

Hi,

that would be fantastic.. I appreciate your help. As far as the script goes, All I have is the sample script that is in the admin guide but I have no idea where to begin to edit it. The custom object the button will be on is called "Pilot__c".

First I'd like to create the custom button so I can actually pull the template from DocuSign into Salesforce....

Then the conditional formatting would come up for the following fields (picture) If yes, make the membership #s and explain the sections required.

Userlevel 1
Badge +12

 

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.

  1. Get the sample button code that DocuSign provides here:
  2. Save this via a text/code editor in your personal code repository as a .js file.
  3. Login to DocuSign and navigate to your Template to get the Template ID:
  4. Copy this Template ID
  5. Open your sample button code in your text/code editor and search for the following: DST = '';
  6. Enter a new line before this text so that it is now on its own line
  7. Paste your Template ID
  8. 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

 

Userlevel 2

You are my hero - I truly appreciate your help. :)

Ok, so I did Steps 1-8. Saved it and tested it, but I got this error: "Invalid or unexpected token"

Here is the code, not sure if I did it right? I also updated the object from "Opportunity" to my custom object Pilot__c.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")}

//********* Option Declarations (Do not modify )*********//

var RC = '';var RSL='';var RSRO='';var RROS='';var CCRM='';var CCTM='';var CCNM='';var CRCL=''; var CRL='';var OCO='';var DST='';var LA='';var CEM='';var CES='';var STB='';var SSB='';var SES='';var SEM='';var SRS='';var SCS ='';var RES='';

//*************************************************//

// Modify individual options here:

// Related Content (default no related content) RC = ''; //Ex: GetRelContentIDs("{!Pilot__c.Id}");

// Recipient Signer Limit (default no limit) RSL = ''; //Ex: '3'

// Recipient Starting Routing Order (default 1) RSRO = ''; // Ex: '1'

// Recipient Routing Order Sequential (default not sequential) RROS = ''; //Ex: '1'

// Custom Contact Role Map (default config role) CCRM = ''; //Ex: 'Decision Maker~Signer1; Economic Buyer~Carbon Copy'

// Custom Contact Type Map (default Signer) CCTM = ''; //Ex: 'Decision Maker~Signer; Economic Buyer~Carbon Copy'

// Custom Contact Note Map (default no note) CCNM = ''; //Ex: 'Decision Maker~Note for DM; Economic Buyer~Note For EB; DEFAULT_NOTE~Default Note'

// Custom Related Contact List (default object contact)

CRCL = '';

// Ex1: Calling individual

// 'MyContacts__r,Email~Email__c;FirstName~First_Name__c;LastName~Last_Name__c;Role~Role__c,LoadDefaultContacts~0'

// Ex2: Calling Signing Group NOTE: OCO = 'Tag' or 'Send' is required for SigningGroup

// 'MyContacts__r,SigningGroup~SigningGroup__c,LoadDefaultContacts~1'

// OCO = 'Tag'; // or 'Send'

// Ex3: Calling Signing Group and Individuals off the same default object contact NOTE: OCO = 'Tag' or 'Send' is required for SigningGroup

// 'MyContacts__r,SigningGroup~SigningGroup__c;Email~Email__c;FirstName~First_Name__;LastName~Last_Name__c;Role~Role__c,LoadDefaultContacts~1'

// OCO = 'Tag'; // or 'Send'

// Custom Recipient List

CRL = '';

// Ex1: Calling Individual

//'Email~;FirstName~;LastName~;Role~SignInPersonName~;RoutingOrder~;AccessCode~;RecipientNote~;SignNow~,LoadDefaultContacts~1'

// Ex2: Calling Signing Group NOTE: OCO = 'Tag' or 'Send' is required for SigningGroup

//’SigningGroup~;Role~;RoutingOrder~;AccessCode~;RecipientNote~,LoadDefaultContacts~1'

// OCO = 'Tag'; // or 'Send'

// One Click Option (default edit envelope screen)

OCO = ''; //Ex. Tag (or Send)

DST=”39650820-584d-4b51-8b48-f25b6332a8e4

// DocuSign Template ID (default no template) DST = ''; //Ex: '67870A79-A0B5-4596-8AC1-CC7CC1EA01EB'

// Load Attachments (default on) LA = ''; //Ex: '0'

// Custom Email Message (default in config) CEM = ''; //Ex: 'Envelope sent by [FirstName] [LastName] ([Email])!'

// Custom Email Subject (default in config) CES = ''; //Ex: 'Re: Opportunity Name: {!Opportunity.Name}'

// Show Tag Button (default in config) STB = ''; //Ex: '1'

// Show Send Button (default in config) SSB = ''; //Ex: '1'

// Show Email Subject (default in config) SES = ''; //Ex: '1'

// Show Email Message (default in config) SEM = ''; //Ex: '1'

// Show Reminder/Expire (default in config) SRS = ''; //Ex: '1'

// Show Chatter (default in config) SCS = ''; //Ex: '1'

// Reminder and Expiration Settings RES = ''; //Ex: '0,1,2,0,120,3'

//********* Page Callout (Do not modify) *********//

window.location.href = "/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0 &SourceID={!Pilot__c.Id}&RC="+RC+"&RSL="+RSL+"&RSRO="+RSRO+"&RROS="+RROS+" &CCRM="+CCRM+"&CCTM="+CCTM+"&CRCL="+CRCL+"&CRL="+CRL+"&OCO="+OCO+" &DST="+DST+"&CCNM="+CCNM+"&LA="+LA+"&CEM="+CEM+"&CES="+CES+" &SRS="+SRS+"&STB="+STB+"&SSB="+SSB+"&SES="+SES+"&SEM="+SEM+" &SRS="+SRS+"&SCS="+SCS+"&RES="+RES;

//*******************************************//

Userlevel 2

Hi,

Disregard the comment above - got it to work... Looks like the conditional formatting is set by however it is in DocuSign. I think I may be good here.

Thanks so much for all your help!

Userlevel 2

WOOHOOO!

Congrats!

Let me know if anything else comes up and how I can help.

Take care,

Arash Sayadi

Userlevel 2

I have this same question. However I wish to stay with Conga Composer as the tool creating the document and not have to lean on using DocuSign templates.

So I guess my question would be stated like this:

"Can I utilise embedded tags in a document so that I can configure a conditional field, such that if a checkbox is completed, a seperate text field is exposed and required to be completed"

I can obviously place fields into a document already via tags, I can even assign which signer is to complete those fields, however i'm unaware how I could establish a defined conditional field link between two fields via embedded tags?

Hopefully you guys can help, as my last reach out to Conga on this issue was at a SMPTE conference in the city and the representative there, said it was only possible to do conditional fields in conga templates.

Fingers crossed you guys know otherwise?

Userlevel 2

 

If you're starting the document composition in Conga, then the conditional formatting would be done in Conga, not DocuSign.

I'm sorry that's not what you wanted to hear.

Take care,

Arash

 

Userlevel 2

Thanks, yes I reached out again to DocuSign support and they confirm, the only way to do conditional fields is in DocuSign templates.

Shame

Userlevel 2

Well. On the upside, you know what doesn't work.

Is there any way you can do this in Conga?

Userlevel 2

No you can't do conditional fields in the way I require them. i.e if one is checked in docusign, the other becomes available to populate. That is a dousing feature

Userlevel 2

Yeah. I like the conditional fields and routing in DS.

What you're trying to do would require the logic of conditional fields to be exposed via the DocuSign embedded tags in Salesforce. I think this is an interesting idea.

If nothing else, you should reach out to your DocuSign Account Manager and suggest that as a product improvement.

Userlevel 2

Yeah thats exactly what Im after. Would be cool

Reply