I have create a template in my Admin Account Panel, and I am using the template to create new envelopes and send to different receivers. But in my template I have a dropdown whose value changes on some condition, like for State A it will have different values, for State B it will have different values. How do I handle it programmatically. Here is how I create an envelope from a template.
string recipientEmail = "a@a.com";
string recipientName = "John Doe";
string templateRoleName = "Customer";
string TemplateId = "xxxxxxxx-c87454e95429";
EnvelopeDefinition envDef = new EnvelopeDefinition();
envDef.EmailSubject = "[DocuSign C# SDK] - Please sign this doc";
// assign recipient to template role by setting name, email, and role name. Note that the
// template role name must match the placeholder role name saved in your account template.
TemplateRole tRole = new TemplateRole();
tRole.Email = recipientEmail;
tRole.Name = recipientName;
tRole.RoleName = templateRoleName;
List<TemplateRole> rolesList = new List<TemplateRole>() { tRole };
// add the role to the envelope and assign valid templateId from your account
envDef.TemplateRoles = rolesList;
envDef.TemplateId = TemplateId;
// set envelope status to "sent" to immediately send the signature request
envDef.Status = "sent";
// |EnvelopesApi| contains methods related to creating and sending Envelopes (aka signature requests)
EnvelopesApi envelopesApi = new EnvelopesApi(cfi);
EnvelopeSummary envelopeSummary = envelopesApi.CreateEnvelope(accountID, envDef);