Philip

Custom Field - passing value to Template

0 votes
Hello, How do you populate a field when creating a package from a template? I don't want to define the field location in my code. Instead I need to simply pass along the value that should appear in the correct location. Some of these uses will be for read only fields and some for pre-populating an input that is required/optional. I've successfully setup a template using the online interface and placed a field with the name "CustomField1" inside the template. But I cannot find how to pass a field value unless I also upload a document and define the field location, which I do not want to do since that is already defined & maintained in the template. Thanks,

Approved Answer

Reply to: Custom Field - passing value to Template

0 votes
Hey Philip, Sorry for the delay. I had been waiting for you account issue to be resolved before posting in this thread anymore, then forgot to post the example. Take a look at this example from the code share to show how to push data to labels and text fields when using a template to create a package. https://developer.esignlive.com/code-share/push-data-fields-creating-package-template-net/ Let me know if you have questions.

- Michael Partner and Developer Technologies Manager, OneSpan Facebook - Twitter - LinkedIn


Reply to: Custom Field - passing value to Template

0 votes
Are you definitely wanting to use templates? If you create your documents as PDF forms, you could automatically extract fields from the PDF and inject text where you want it at package creation or document upload (if adding to an existing package) time. Let me know.

- Michael Partner and Developer Technologies Manager, OneSpan Facebook - Twitter - LinkedIn


Reply to: Custom Field - passing value to Template

1 votes
Thank you for responding Michael. Yes I was asking about using the template. If this feature does not exist we can probably achieve everything by using PDF form fields. I just wanted to make sure I knew how to implement that feature if it existed because sometimes its the only way to solve an issue without defining field locations in code and sometimes its just quicker/simpler solution.

Reply to: Custom Field - passing value to Template

0 votes
The only difference between a template vs creating the PDF form and uploading with code each time is that with a template, you don't have to re-upload the document each time. Instead, it duplicates the document inside eSignLive. Uploading the document each time probably won't cause too much more of a delay, but would probably be the simplest way to simply inject text into the fields you want to inject it into, without specifying a location. I'll work on a simple example of the template way for you though. I'll post it in the code share and add a link, in here.

- Michael Partner and Developer Technologies Manager, OneSpan Facebook - Twitter - LinkedIn


Reply to: Custom Field - passing value to Template

0 votes
Hi Michael, I'm trying to do something similar. So I have a PDF form with many input fields, if I use it to create a template, is it possible to inject values into it without uploading the PDF again? Based on the example provided with the Silanis SDK and what you said above, I'm under the impression that the only way to do this is to replace the original PDF with the values-injected version, so basically uploading a file again. In that case, there doesn't seem to be a lot of benefits from using a template. Is that correct?

Reply to: Custom Field - passing value to Template

0 votes
Thanks Michael, that last bit was what I was after. Field Field2 = mydoc.Signatures[0].Fields[0]; Field2.Value = "My editable value"; eslClient.ApprovalService.ModifyField(packageId, docId, sigId, Field1);

Reply to: Custom Field - passing value to Template

0 votes
Philip, glad I could help! :) yl-qtrade, Yes, this is correct. Templates were probably originally designed with the UI in mind, not from the API/SDK. From the API/SDK, your class essentially works as a template does. If you truly want to inject data into the document in PDF form fields that are in your original PDF, you'll need to do this at the time of upload. Hope this helps.

- Michael Partner and Developer Technologies Manager, OneSpan Facebook - Twitter - LinkedIn


Reply to: Custom Field - passing value to Template

0 votes
Hello, When i use your example, I am getting this message while trying to sign the document ("Warning, the form is incomplete")?? Why? What is wrong? Thanks

Reply to: Custom Field - passing value to Template

0 votes
Hello nehme, Are you using the code exactly from the example? Or have you modified the idea into your own example? Can you please share your code (with no API Key or personal info included)?

- Michael Partner and Developer Technologies Manager, OneSpan Facebook - Twitter - LinkedIn


Reply to: Custom Field - passing value to Template

0 votes
Hello, Thanks for your reply. The issue was simple, I just went for each field in the templates UI and click settings for it and click save. This solve my problem. Thanks :)

Reply to: Custom Field - passing value to Template

0 votes
Great! Glad you found your issue! Let us know whenever you have any other questions. :)

- Michael Partner and Developer Technologies Manager, OneSpan Facebook - Twitter - LinkedIn


Reply to: Custom Field - passing value to Template

0 votes
Hello, How I can get the Field index when I create it in template? Thanks

Reply to: Custom Field - passing value to Template

0 votes
This example was very simple. In a real scenario, you'd likely loop through the signatures and find the field by name rather than simply using static values.

- Michael Partner and Developer Technologies Manager, OneSpan Facebook - Twitter - LinkedIn


Reply to: Custom Field - passing value to Template

0 votes
Can you give me an .net sdk example about how to do this? Thanks

Reply to: Custom Field - passing value to Template

0 votes

How can i create a custom fields? the fields custom they are by package?


Reply to:

0 votes

Hi csar,

 

Thanks for your post! Custom Fields in OneSpan Sign offers you the ability to add supplementary information to your sender profiles in addition to the out-of-the-box fields like “title”, “company”. These custom fields can later be added to your transactions, and the values will be populated to the document after signing.You can only create custom fields for senders at the account level. To learn more about custom fields, refer to my blogs:
OneSpan Sign Developer – Custom Fields

OneSpan Sign Developer – Custom Fields Part 2

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off