The BoldSign mobile app is now available. Visitthis link for more details and give it a try!

The BoldSign mobile app is now available. Visitthis link for more details and give it a try!

Request Demo
BoldSign Logo Small

Features

Explore the BoldSign features that make eSigning easier.

Creating Conditional Fields in eSignature Documents with the BoldSign API

Creating Conditional Fields in eSignature Documents with the BoldSign API

The ability to customize document form fields dynamically based on user input is crucial for enhancing efficiency and user experience. This powerful feature is available in BoldSign in the form of conditional fields. With the BoldSign API, developers can easily implement conditional logic to create documents with fields that appear or disappear based on predefined rules. In this blog post, we will explore how to create conditional fields using the BoldSign API.

Introduction to conditional fields

Conditional fields enable document creators to streamline the signing process by presenting only relevant fields to signers based on their selections. This not only enhances the user experience but also ensures accuracy and efficiency in document completion.

Creating conditional fields using radio buttons

Radio buttons are commonly used for single-choice selections. They allow the user to select only one option from a predefined list. When a radio button is selected, additional fields can be displayed based on that selection. This ensures that only relevant information is collected, reducing the chance of errors and simplifying the form-filling process.

Let’s see how we can create conditional fields based on radio button selections using the BoldSign API.

    
curl -X POST 'https://api.boldsign.com/v1/document/send' \
  -H 'accept: application/json' \
  -H 'X-API-KEY: {Your API key}' \
  -H 'Content-Type: multipart/form-data' \
  -F 'Signers={
    "name": "David",
    "emailAddress": "david@cubeflakes.com"",
    "signerOrder": 0,
    "signerType": "Signer",
    "formFields": [
      {
        "id": "Signature1",
        "name": "Signature1",
        "fieldType": "Signature",
        "pageNumber": 1,
        "bounds": {
          "x": 140,
          "y": 190,
          "width": 82,
          "height": 32
        },
        "isRequired": false
      },
      {
        "id": "Initial1",
        "name": "Initial",
        "fieldType": "Initial",
        "pageNumber": 1,
        "bounds": {
          "x": 340,
          "y": 190,
          "width": 82,
          "height": 32
        },
        "isRequired": false
      },
      {
        "id": "RadioButton1",
        "name": "RadioButton",
        "fieldType": "RadioButton",
        "groupName": "ConditionalLogic",
        "pageNumber": 1,
        "bounds": {
          "x": 340,
          "y": 390,
          "width": 20,
          "height": 20
        },
        "value": "off",
        "conditionalRules": [
          {
            "fieldId": "Signature1",
            "isChecked": true
          }
        ],
        "isRequired": false
      },
      {
        "id": "Radiobutton2",
        "name": "RadioButton",
        "fieldType": "RadioButton",
        "groupName": "ConditionalLogic",
        "pageNumber": 1,
        "bounds": {
          "x": 140,
          "y": 590,
          "width": 20,
          "height": 20
        },
        "value": "off",
        "conditionalRules": [
          {
            "fieldId": "Initial1",
            "isChecked": true
          }
        ],
        "isRequired": false
      }
    ],
    "language": 1
  }' \
  -F 'Files=@{Your file path}' \
  -F 'Title={Your document title}'
 
In this example, we defined conditional rules for two radio buttons. Depending on which radio button is selected, the signer will see either a Signature field or an Initial field.

Creating conditional fields using checkboxes

Checkboxes allow users to make multiple selections from a list of options. When a checkbox is checked or unchecked, different fields can be displayed based on these selections. This helps gather more specific information relevant to the user’s choices.

Here’s how you can implement this using the BoldSign API:

    
curl -X POST ‘https://api.boldsign.com/v1/document/send’ \
  -H ‘accept: application/json’ \
  -H ‘X-API-KEY: {Your API key}’ \
  -H ‘Content-Type: multipart/form-data’ \
  -F ‘Signers={
    “name”: “David”,
    “emailAddress”: “david@cubeflakes.com”,
    “signerOrder”: 0,
    “signerType”: “Signer”,
    “formFields”: [
      {
        “id”: “Signature1”,
        “name”: “Signature1”,
        “fieldType”: “Signature”,
        “pageNumber”: 1,
        “bounds”: {
          “x”: 140,
          “y”: 190,
          “width”: 82,
          “height”: 32
        },
        “isRequired”: false
      },
      {
        “id”: “Initial1”,
        “name”: “Initial”,
        “fieldType”: “Initial”,
        “pageNumber”: 1,
        “bounds”: {
          “x”: 340,
          “y”: 190,
          “width”: 82,
          “height”: 32
        },
        “isRequired”: false
      },
      {
        “id”: “Checkbox1”,
        “name”: “Checkbox”,
        “fieldType”: “Checkbox”,
        “pageNumber”: 1,
        “bounds”: {
          “x”: 340,
          “y”: 390,
          “width”: 20,
          “height”: 20
        },
        “value”: “off”,
        “conditionalRules”: [
          {
            “fieldId”: “Signature1”,
            “isChecked”: true
          },
          {
            “fieldId”: “Initial1”,
            “isChecked”: false
          }
        ],
        “isRequired”: false
      }
    ],
    “language”: 1
  }’ \
  -F ‘Files=@{Your file path}’ \
  -F ‘Title={Your document title}’
 

In this example, we defined a checkbox field where a Signature field is displayed when the checkbox is selected and an Initial field is displayed when the checkbox is cleared.

Creating conditional fields using dropdown menus

Dropdowns offer a list of options in a compact format. They are particularly useful when you want to present a long list of choices without taking up too much space on a form. Based on the dropdown selection, different fields can be shown to the user, ensuring that the form remains concise and relevant.

Let’s explore how to create conditional fields based on dropdown selections with the BoldSign API:

    
curl -X POST ‘https://api.boldsign.com/v1/document/send’ \
  -H ‘accept: application/json’ \
  -H ‘X-API-KEY: {Your API key}’ \
  -H ‘Content-Type: multipart/form-data’ \
  -F ‘Signers={
    “name”: “David”,
    “emailAddress”: “david@cubeflakes.com”,
    “signerOrder”: 0,
    “signerType”: “Signer”,
    “formFields”: [
      {
        “id”: “Signature1”,
        “name”: “Signature1”,
        “fieldType”: “Signature”,
        “pageNumber”: 1,
        “bounds”: {
          “x”: 140,
          “y”: 190,
          “width”: 82,
          “height”: 32
        },
        “isRequired”: false
      },
      {
        “id”: “Initial1”,
        “name”: “Initial”,
        “fieldType”: “Initial”,
        “pageNumber”: 1,
        “bounds”: {
          “x”: 340,
          “y”: 190,
          “width”: 82,
          “height”: 32
        },
        “isRequired”: false
      },
      {
        “id”: “Dropdown1”,
        “name”: “Dropdown”,
        “fieldType”: “Dropdown”,
        “pageNumber”: 1,
        “bounds”: {
          “x”: 340,
          “y”: 390,
          “width”: 20,
          “height”: 20
        },
        “dropdownOptions”: [
          “1”,
          “2”
        ],
        “value”: “1”,
        “conditionalRules”: [
          {
            “fieldId”: “Signature1”,
            “value”: “1”
          },
          {
            “fieldId”: “Initial1”,
            “value”: “2”
          }
        ],
        “isRequired”: false
      }
    ],
    “language”: 1
  }’ \
  -F ‘Files=@{Your file path}’ \
  -F ‘Title={Your document title}’
 
In this example, we defined conditional rules for a dropdown field. Depending on the selected option, either the Signature field or the Initial field will be displayed.

Conclusion

Conditional fields are vital to customizing document forms to match specific requirements and user preferences. With the BoldSign API, integrating conditional logic into document creation processes becomes seamless and efficient. By following the examples in this blog and experimenting with different scenarios, you can leverage conditional fields to optimize your document workflows and enhance signer experiences. Start incorporating conditional fields into your documents today with the BoldSign API!

Refer to this documentation for additional information on creating conditional fields via the BoldSign API in different programming languages.
Start your 30-day BoldSign free trial now to get your documents signed on time, every time. Schedule a demo or contact our support team via our support portal if you have any questions or would like more information about our services. Feel free to leave a comment below; your thoughts are much appreciated.
Picture of Gopinath Kannusamy

Gopinath Kannusamy

Gopinath is a passionate software developer with 2 years of experience at BoldSign. He is an avid writer and enjoys sharing his insights on technology and development. In his free time, he enjoys exploring new technologies and learning new things.

Share this blog

Picture of Gopinath Kannusamy

Gopinath Kannusamy

Gopinath is a passionate software developer with 2 years of experience at BoldSign. He is an avid writer and enjoys sharing his insights on technology and development. In his free time, he enjoys exploring new technologies and learning new things.

Subscribe RSS feed

Leave a Reply

Your email address will not be published. Required fields are marked *