Injecting Field Values - Checkboxes and Radio buttons
Tuesday, April 18, 2023 at 10:38amCan 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
Tuesday, April 18, 2023 at 12:03pmHi 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
Reply to: Injecting Field Values - Checkboxes and Radio buttons
Tuesday, April 25, 2023 at 01:45pmHi 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
Friday, April 28, 2023 at 09:39amHi 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
Reply to: Injecting Field Values - Checkboxes and Radio buttons
Tuesday, May 2, 2023 at 12:40pmThank 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
Tuesday, May 2, 2023 at 02:04pmHi 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
Reply to: Injecting Field Values - Checkboxes and Radio buttons
Tuesday, May 2, 2023 at 02:11pmYes, 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
Tuesday, May 2, 2023 at 02:17pmYou 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
Reply to: Injecting Field Values - Checkboxes and Radio buttons
Wednesday, May 10, 2023 at 10:00amThank 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
Wednesday, May 10, 2023 at 10:03amHi 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
Reply to: Injecting Field Values - Checkboxes and Radio buttons
Wednesday, May 10, 2023 at 11:08amHi 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.