How to prefill values for radio button after sending document for signature?
BoldSign allows you to prefill values for existing form fields after sending document for e-Signature. However, it's important to note that prefilling form fields is not allowed after the document has been signed by the signer.This article provides a guide on how to prefill values for radio button fields.
To prefill values for existing form fields in a document, you need to use the Properties API to retrieve the form field IDs and assign values to these fields.
For more details, read about the Document Properties API.
Once you have the IDs for the radio button and assign the value to which radio button you want to prefill the value.
Here is an example demonstrating how to prefill radio button values after sending a document for e-Signature:
Code snippet
curl --location --request PATCH ' https://api.boldsign.com/v1-beta/document/prefillFields?documentId=2d60c66a-xxxx-xxxx-904b-f8d0c4f02241' \ --header 'X-API-KEY: {Your API Key}' \ --header 'Content-Type: application/json' \ --data-raw '{ "fields": [ { "id": "RadioGroupChild1", "value": "ON" }, { "id": "RadioGroupChild2", "value": "OFF" } ] }'
using BoldSign.Api; using BoldSign.Api.Model; var apiClient = new ApiClient("https://api.boldsign.com", "{Your API Key}"); var documentClient = new DocumentClient(apiClient); var documentId = "2d60c66a-xxxx-xxxx-904b-f8d0c4f02241"; var prefillFieldRequest = new PrefillFieldRequest(documentId) { Fields = new List<PrefillField>() { new PrefillField() { Id = "RadioGroupChild1", Value = "ON" }, new PrefillField() { Id = "RadioGroupChild2", Value= "OFF" } }, }; await documentClient.PrefillFieldsAsync(prefillFieldRequest);
import requests url = 'https://api.boldsign.com/v1-beta/document/prefillFields' headers = { 'Content-Type': 'application/json', 'X-API-KEY': '{Your API Key}' } data = { "fields": [ { "id": "RadioGroupChild1", "value": "ON" }, { "id": "RadioGroupChild2", "value": "OFF" } ] } document_id = '2d60c66a-xxxx-xxxx-904b-f8d0c4f02241' params = {'documentId': document_id} response = requests.patch(url, headers=headers, json=data, params=params) print(response.text)
const axios = require('axios'); const url = 'https://api.boldsign.com/v1-beta/document/prefillFields'; const apiKey = '{Your API Key}'; const documentId = '2d60c66a-xxxx-xxxx-904b-f8d0c4f02241'; const headers = { 'Content-Type': 'application/json', 'X-API-KEY': apiKey }; const data = { fields: [ { id: 'RadioGroupChild1', value: 'ON' }, { id: 'RadioGroupChild2', value: 'OFF' } ] }; axios.patch(url, data, { headers, params: { documentId } }) .then(response => { console.log(response); }) .catch(error => { console.error('Error:', error); });
In the provided code examples, make sure to replace the documentId
with the actual ID of the document you created. Once the above code is executed, the radio button form field will be successfully prefilled with the provided values in the document.