• Blog

How to Automatically Add Document Fields by Using Text Tags

how-to-automatically-add-document-fields

Table of Contents

Sign Docs 3x Faster

Send, sign, and manage documents securely and efficiently.

Automatically adding document fields using text tags streamlines the eSignature process, ensuring that fields are placed correctly and consistently without manual intervention. Knowing the exact coordinates (x- and y-values) for placing form fields can be challenging and time-consuming, as it often requires manual adjustments to ensure precision. By using BoldSign text tags, you can bypass this, allowing the system to position the fields accurately based on predefined tags in your document. This blog walks you through how to use BoldSign text tags to enhance your document preparation process.

What are text tags?

Text tags are placeholders embedded within a document that BoldSign identifies and replaces with the corresponding form fields during the document sending process. These tags are efficient for repetitive tasks, ensuring that every required field is present and correctly positioned.

Imagine you are responsible for sending out sales orders to customers for signatures. Each sales order requires multiple fields, such as signature, date, and text fields for customer information. Determining the exact x- and y-coordinates for each of these fields can be challenging and time-consuming.

Using BoldSign text tags, you can automate the placement of these fields within your sales order documents. You add the tags while preparing the document without manually specifying their coordinates. This simplifies the document preparation process, ensures consistent field placement, and saves time.

Steps to implement text tags in BoldSign

Step 1: Prepare your document

When generating a document, insert text tags where you want the fields to appear. For example, if you need a signature field, a date field, and a text field for the customer’s name, you will add tags like this:


{{sign|1|*| |sign_field_1}}
{{date|1|*| |date_field_1}}
{{text|1|*|Customer Name|text_field_1}}
    

Step 2: Enable text tags in the API

Once the document is prepared with text tags, upload and send your document using the BoldSign API. When doing so, ensure the UseTextTags property is set to true. This enables the API to recognize and interpret the text tags within the document.


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 'Title="Sales Order"' \
  -F 'UseTextTags=true' \
  -F 'Signers={
  "name": "John Doe",
  "emailAddress": [email protected],
  "signerType": "Signer",
  "signerRole": "Customer",
  "locale": "EN"
}' \
  -F 'Files=@{your file}'
    

Supported text tags

BoldSign supports various text tags for different field types. Following are some common tags.

Form FieldTag ExampleDefinition
Signature{{sign|1|*| |sign_1}}A required signature field assigned for the first signer with an ID.
Initials{{init|1|*| |init_1}}A required initial field assigned for the first signer with an ID.
Date Signed{{date|1|*| |date_1}}A required date signed field assigned for the first signer with an ID.
Editable Date{{editdate|1|*| |editdate_1}}A required editable date field assigned for the first signer with an ID.
Text Box{{text|1|*|Customer Name|text_1}}A required text box field assigned for the first signer with a placeholder with an ID.
Title{{title|1|*| |title_1}}A required title field assigned for the first signer with an ID.
Company{{company|1|*| |company_1}}A required company field assigned for the first signer with an ID.

Note: The placeholder is only supported for the text box fields among these form fields.

Advanced options: definition tags

When text tags contain numerous directives or you want to use the fields other than the ones previously listed, you can use definition tags. Definition tags provide a structured approach to managing complex text tags, allowing developers to encapsulate field configurations for improved readability and efficiency.

To incorporate definitions into text tags, usage begins with @ followed by the definition ID from the TextTagDefinitions provided in the send request. Following is a sample syntax using the definition ID tag1.


{{@tag1}}
    

Once the document is prepared with the definition tags, you can upload it and define its properties while making the API request.


curl -X POST 'https://api.boldsign.com/v1/document/send' \
  -H 'X-API-KEY: {your-api-key}' \
  -F 'Title=Sales Order with Definitions' \
  -F 'Signers[0][Name]=John Doe' \
  -F 'Signers[0][EmailAddress][email protected]' \
  -F 'Signers[0][SignerType]=Signer' \
  -F 'UseTextTags=true' \
  -F 'TextTagDefinitions[0][DefinitionId]=tag1' \	
  -F 'TextTagDefinitions[0][Type]=TextBox' \
  -F 'TextTagDefinitions[0][SignerIndex]=1' \
  -F 'TextTagDefinitions[0][IsRequired]=true' \
  -F 'TextTagDefinitions[0][FieldLabel]=Email' \
  -F 'TextTagDefinitions[0][FieldId]=email_1' \
  -F 'TextTagDefinitions[0][Size][Width]=300' \
  -F 'TextTagDefinitions[0][Size][Height]=50' \
  -F 'TextTagDefinitions[0][Placeholder]=Enter your email' \
  -F 'TextTagDefinitions[0][PageNumber]=1' \
  -F 'Files=@{your file};type=application/pdf'
    

Sample document showing text tags

Sample document showing text tags

Text tags replaced with the BoldSign form fields in the document

Text tags replaced with the BoldSign form fields

Notes:

  • The text tags that are placed in the document will not be removed, so it is recommended that the color of the text tags match the background color of the document.
  • If the recipient number is not specified in the tags, it will be allocated to the first recipient as default. For example: {{ text}}
  • Text fields and checkboxes can be marked as required with the asterisk symbol. For example: {{  text|1|*|}}
  • You can also expand a field’s width by adding space between the text tag and the braces. For example: {{ text|1|*|}}.
  • Remember that the tags must be on a single line, with the spacing provided at the end or beginning of the text tag.

Conclusion

Using BoldSign text tags, you can automatically add fields to your documents and streamline your document preparation process. By integrating these tags into your workflows, you ensure that all necessary fields are accurately and consistently placed, enhancing efficiency and reducing errors. For further guidance and examples, refer to our demo sample and explore the text tag documentation and explore the add tag documentation.

Experience the text tag feature for yourself by starting a 30-day free trial. If you have any questions or need further assistance, please schedule a demo or reach out to our support team through our support portal.

Like what you see? Share with a friend.

Latest blog posts

Modern Background Jobs in ASP.NET Core: Hosted Services vs Hangfire vs Quartz.NET

Modern Background Jobs in ASP.NET Core: Hosted Services vs Hangfire vs Quartz.NET

Compare ASP.NET Core Hosted Services, Hangfire, and Quartz.NET to choose the right background job tool for scheduling, retries, scalability, and reliability.

Keep Signing Processes Active by Extending Document Expiry with BoldSign API

Keep Signing Processes Active by Extending Document Expiry with BoldSign API

Extend document expiry using the BoldSign API. Learn expiry types, rules, and best practices to keep signing workflows running smoothly.

Keep Contract Template Changes Under Control with BoldSign

Keep Contract Template Changes Under Control with BoldSign

Learn how BoldSign’s Template Usage Settings safeguard your documents from unauthorized edits by locking files, fields, recipients, and messages for compliance.

Sign up for your free trial today!

  • tick-icon
    30-day free trial
  • tick-icon
    No credit card required
  • tick-icon
    30-day free trial
  • tick-icon
    No credit card required
signup-banner