BoldSign AI Assistant
Chat with the BoldSign AI AssistantPrefill Radio Fields After Sending a Document
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 boldsign
configuration = boldsign.Configuration(host = "https://api.boldsign.com", api_key = "YOUR_API_KEY")
with boldsign.ApiClient(configuration) as api_client:
document_api = boldsign.DocumentApi(api_client)
prefill_field = [
boldsign.PrefillField(
id = "RadioGroupChild1",
value = "ON"
),
boldsign.PrefillField(
id = "RadioGroupChild2",
value = "OFF"
)
]
prefill_field_request = boldsign.PrefillFieldRequest(fields = prefill_field)
document_api.prefill_fields(document_id = "YOUR_DOCUMENT_ID", prefill_field_request = prefill_field_request)
<?php require_once "vendor/autoload.php";
$config = new BoldSign\Configuration();
$config->setHost("https://staging-api.boldsign.com");
$config->setApiKey('YOUR_API_KEY');
$documentApi = new BoldSign\Api\DocumentApi($config);
$prefillField1 = new BoldSign\Model\PrefillField();
$prefillField1->setId('RadioGroupChild1');
$prefillField1->setValue('ON');
$prefillField2 = new BoldSign\Model\PrefillField();
$prefillField2->setId('RadioGroupChild2');
$prefillField2->setValue('OFF');
$prefillRequest = new BoldSign\Model\PrefillFieldRequest();
$prefillRequest->setFields([$prefillField1, $prefillField2]);
$documentApi->prefillFields('YOUR_DOCUMENT_ID', $prefillRequest);
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("https://api.boldsign.com");
client.setApiKey("YOUR_API_KEY");
DocumentApi documentApi = new DocumentApi(client);
PrefillField field1 = new PrefillField();
field1.setId("RadioGroupChild1");
field1.setValue("ON");
PrefillField field2 = new PrefillField();
field2.setId("RadioGroupChild2");
field2.setValue("OFF");
PrefillFieldRequest prefillRequest = new PrefillFieldRequest();
prefillRequest.setFields(Arrays.asList(field1, field2));
documentApi.prefillFields("YOUR_DOCUMENT_ID", prefillRequest);
import * as boldsign from "boldsign";
const documentApi = new boldsign.DocumentApi("https://api.boldsign.com");
documentApi.setApiKey("YOUR_API_KEY");
const field1 = new boldsign.PrefillField();
field1.id = "RadioGroupChild1";
field1.value = "ON";
const field2 = new boldsign.PrefillField();
field2.id = "RadioGroupChild2";
field2.value = "OFF";
const prefillFieldRequest = new boldsign.PrefillFieldRequest();
prefillFieldRequest.fields = [field1, field2];
documentApi.prefillFields("YOUR_DOCUMENT_ID", prefillFieldRequest);
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.