1

I am running Swift sample from https://github.com/docusign/native-ios-sdk.

I want to pre-fill a Custom field(Data Label - "fullNameLabel") that i have assigned to a field in my template/document. I have tried sending let dict = ["fullNameLabel":"tom wood"] and let dict = ["tabLabel":"fullNameLabel","value":"tom wood"] in DSMEnvelopeDefaults object's tabValueDefaults property and calling

- (void)presentSendTemplateControllerWithTemplateWithId:(NSString *)templateId
                                   envelopeDefaults:(DSMEnvelopeDefaults *)envelopeDefaults
                                        pdfToInsert:(NSData *)pdfToInsert
                                   insertAtPosition:(DSMDocumentInsertAtPosition)insertAtPosition
                                        signingMode:(DSMSigningMode)signingMode
                               presentingController:(UIViewController *)presentingController
                                           animated:(BOOL)animated
                                         completion:(void(^)(UIViewController *viewController, NSError *error))completion;

But when the document loads the field does not get pre-populated. What could be the issue?

hemant
  • 1,729
  • 4
  • 31
  • 43

1 Answers1

1

There could be a few reasons for not seeing the fields pre-populated. Most likely, the template you are using doesn't have a text tab with tabLabel = "fullNameLabel". Ensure this by cross-checking the tabLabel on the template. The sample template has a label defined as "Text FullName" in Guide: Using Envelope Defaults. Link to template json with "Text FullName" tabLabel.

let dict = ["fullNameLabel":"tom wood"] --> This should work, as long as you're setting both recipientDefaults and tabDefaults.

let envelopeDefaults = DSMEnvelopeDefaults()
// Set the tab default values
envelopeDefaults.tabValueDefaults = tabData 
// Also set recipient default (required for tab defaults)
envelopeDefaults.recipientDefaults = recipientDefault 

let dict = ["tabLabel":"fullNameLabel","value":"tom wood"] --> This Dictionary<String, String> won't work as it expects the format to be in tabLabel:defaultValue pair.

For extra details and step by step guide, take a look at Using Envelope Defaults.

ashokds
  • 1,656
  • 1
  • 4
  • 11