This topic contains 7 replies, has 2 voices, and was last updated by  Duo_Liang 1 month, 1 week ago.

  • Author
    Posts
  • Participant
    delta360
    Newbie
    Member since: 14.03.2018
    Number of posts: 8

    Hi,

    The following link provides detail on how to pass tags to eSign.

    https://www.esignlive.com/blog/esignlive-how-to-text-tags

    How do you retrieve the value of the tags back once the document has been signed programmatically?

    Thaban

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 520

    Score

    0

    Hi Thaban,

    Thanks for the posting! And just to confirm with you, do you mean how to locate the fields created by text tag and grab the value of the field?
    If so, you can assign names for your fields by your text tag in this way:

    {{Xesl[_fieldName]:roleName:fieldType[:parameter1,parameter2,...]}}    //pattern
    {{esl_reCapture1:re:capture:size(150,30),offset(0,-10)}}                                 //an example where the roleName is re, the field is a capture signature field and the field name is "reCapture1"

    You can get more information about text tag usage in this document site.

    In this way, you can grab the package object, loop through all fields and find the field with this name and get the properties you want.

    Hope this could help!
    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    Participant
    delta360
    Newbie
    Member since: 14.03.2018
    Number of posts: 8

    Score

    0

    Hi,

    My question is that once the user has input the values. How do I read what the value was back? If we create a field for email and the user signs the documents. I need to read what the user inputted in the field programmatically back. The documentation provides on how to create the tags field and send it to the user to input and read the document back in pdf but I need to read what values were inputted in these tags field.

    You mentioned grabbing the package object and looping through all fields? What property is that?

    Thaban

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 520

    Score

    0

    Hi Thaban,

    Sorry for the misunderstanding and let me put it in this way.
    Attachment1 is the document with text tag I was using to generate the package.
    Attachment2 is the screenshot when I finish the package. (Currently, there’s a known issue with text tag lefting partial text after processing as shown from the attachment, will let you know when it’s fixed)
    Attachment3 is the json result you can see after package is completed.
    So from what we have discussed above, you can assign the name of your field using text tag, and you will see this name in the field json.

    {
                                "binding": null,
                                "validation": {
                                    "required": false,
                                    "maxLength": 4000,
                                    "minLength": null,
                                    "enum": null,
                                    "errorMessage": "",
                                    "errorCode": null,
                                    "pattern": ""
                                },
                                "id": "reEmail1",
                                "top": 180,
                                "page": 0,
                                "data": null,
                                "extractAnchor": null,
                                "subtype": "TEXTFIELD",
                                "extract": false,
                                "width": 150,
                                "height": 30,
                                "left": 192,
                                "type": "INPUT",
                                "value": "signer1@mailinator.com",
                                "name": "reEmail1"
                            }

    In this case, id and name of the field are replaced by the value we set “reEmail1” and with this, it’s very easy for you to locate this field and get the value of the textfield using following code:

    String apiKey = "MThFWkRMNDR4Z3NYOkt1cWlLMU0xWVA4TA==";
                String apiUrl = "https://sandbox.esignlive.com/api";
    
                EslClient eslClient = new EslClient(apiKey, apiUrl);
    
                var emailValue = "";
    
                DocumentPackage docPack = eslClient.GetPackage(new PackageId("fE0AxLZirTtkTBwbQQc-g7q7mGg="));
    
                Document document = eslClient.PackageService.GetDocumentMetadata(docPack, "bd5075a410540404d2deacc8cd93a9e1648158553ac9ef05");
    
                foreach (var approval in document.Signatures) {
                    foreach (var field in approval.Fields) {
                        if (field.Id.Equals("reEmail1")) {
                            emailValue = field.Value;
                        }
                    }
                }
                Debugger.Log(1, "Debug", emailValue + "\n");

    You can find the complete code in the attachment.

    Hope this could help!
    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    Attachments:
    You must be logged in to view attached files.
    Participant
    delta360
    Newbie
    Member since: 14.03.2018
    Number of posts: 8

    Score

    0

    Hi,

    Thank you for this. I think this is exactly what I was looking for. Just curious what’s the difference between document.Fields vs document.Signatures.Fields?

    Thaban

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 520

    Score

    0

    Hi Thaban,

    Fields at document level is used for “Field Injection” Feature. It’s to inject text contents for your pdf using pdf forms to locate the position. And after the document is uploaded to OneSpan Sign, these document level fields become part of the document and won’t exist in the package JSON again that’s why when you grab the document object from OneSpan Sign, the size of the document.Fields is 0;

    While fields at signature/approval level are signature/date/textfields/radio button these components. They will always exist in your document metadata and show up during signing ceremony.

    Hope this could help!
    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    Participant
    delta360
    Newbie
    Member since: 14.03.2018
    Number of posts: 8

    Score

    0

    Thanks for all your help

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 520

    Score

    0

    Hi there,

    The issue mentioned in this thread that “text tag lefting partial text after processing” is fixed in 11.20 version. And 11.20 version is already deployed to Sandbox environment.

    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist

You must be logged in to reply to this topic.