hcd-integrations

Injecting Field Values - Checkboxes and Radio buttons

0 votes

Can a checkbox or radio button be "checked" or selected by sending a value in the JSON payload? We are having trouble getting a checkbox to show up as selected or checked. Text fields work fine. We have sent values for the checkbox such as "X", "1", "true", "on" and nothing works.

We are doing this through REST API calls.


Reply to: Injecting Field Values - Checkboxes and Radio buttons

0 votes

Hi there,

 

Set the field value as "X" (string, upper case) should select a radio button / checkbox by default. Can you directly create a testing transaction with payload like below?

{
  "roles": [
    {
      "id": "Signer1",
      "signers": [
        {
          "email": "[email protected]",
          "firstName": "John",
          "lastName": "Smith"
        }
      ]
    }
  ],
  "documents": [
    {
      "approvals": [
        {
          "role": "Signer1",
          "fields": [
            {
              "page": 0,
              "top": 100,
              "subtype": "FULLNAME",
              "height": 50,
              "left": 100,
              "width": 200,
              "type": "SIGNATURE"
            },
            {
              "id": "signer1_group1_radio1",
              "name": "signer1_group1_radio1",
              "type": "INPUT",
              "subtype": "RADIO",
              "page": 0,
              "height": 15,
              "width": 15,
              "left": 100,
              "top": 200,
              "value": "X",
              "validation": {
                "required": true,
                "enum": [
                  "group1"
                ]
              }
            }
          ]
        }
      ],
      "name": "Test Document"
    }
  ],
  "name": "Test Radio Button",
  "language": "en",
  "description": "New Transaction",
  "autocomplete": true,
  "status": "SENT"
}

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Injecting Field Values - Checkboxes and Radio buttons

0 votes

Hi Duo. So we created a JSON payload (attached) and uploaded our forms. We get a response that the package is successfully created. However, when we query the package through an API call (ex. https://sandbox.esignlive.com/api/packages/S4Yk7Df3CmNpZaGtG6WmT14gbOU=) the JSON we get back does indeed contain all the field injected values we sent, including X for the checkboxes and radio buttons. 

However, when we sign into our OneSpan sandbox and view the forms on the dashboard, they contain no field injected values. The fields are all blank. 

 


Reply to: Injecting Field Values - Checkboxes and Radio buttons

0 votes

Hi there,

 

Thanks for the information! From the JSON payload, it looks like you are using Position Extraction to locate the fields. If I was using the attached PDF and the JSON (I made some slight changes to your JSON), I have a screenshot shows how it should look like during signing ceremony.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Attachments

Reply to: Injecting Field Values - Checkboxes and Radio buttons

0 votes

Thank you Duo. We are able to see the data now. Question: if we upload a PDF that has condition logic for some of the fields, will OneSpan create the template and keep that logic or do we need to add it to the JSON payload?


Reply to: Injecting Field Values - Checkboxes and Radio buttons

0 votes

Hi there,

 

Do you mean if your JSON payload needs to carry the "conditions" node every time? If I understood you correctly, OneSpan Sign won't store the logic and you need to add it to the JSON payload every time.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Injecting Field Values - Checkboxes and Radio buttons

0 votes

Yes, that's correct. Are there any examples of what that conditions node would look like in the JSON payload?


Reply to: Injecting Field Values - Checkboxes and Radio buttons

0 votes

You can refer to my blog series for more detailed information:
https://www.onespan.com/blog/onespan-sign-developer-conditional-fields-part-1

https://www.onespan.com/blog/onespan-sign-developer-conditional-fields-part-2

https://www.onespan.com/blog/onespan-sign-developer-conditional-fields-part-3

 

In particular, you'll find JSON example in part2.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Injecting Field Values - Checkboxes and Radio buttons

0 votes

Thank you Duo. We had the samples working but now we're getting errors back such as this, even though we send one document and a very simple payload, which hasn't changed.

{"messageKey":"error.validation.documentPreVerifyInvalidResponseNumberError","parameters":{"errorException":"number of documents that need verification = 2, number of verification results = 0"},"message":"The number of Pre-Verify results does not match the number of documents that were sent for verification.","code":400,"name":"Validation Error"}


Reply to: Injecting Field Values - Checkboxes and Radio buttons

0 votes

Hi there,

 

Can I have the JSON and the document you are using? If there's no sensitive information, you can share here or send to [email protected].

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Injecting Field Values - Checkboxes and Radio buttons

0 votes

Hi Duo. I sent an example to the email address above. It has the full payload we send, in addition to the .pdf file. This has been working up until this morning and now, no matter what docs or payload combinations we send, we always get the same error back from OneSpan. We are currently testing on our Sandbox environment.


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