Unlocking the Power of Mail-Merging Variables in 3B Forms

From 3B Knowledge
Jump to navigation Jump to search

3B Forms v4 brings an incredible feature to the table – the ability to harness the power of mail-merging variables within your forms. Whether you're creating contracts, invoices, timesheets, or any other document that requires dynamic data insertion, this feature is designed to make your life easier. In this article, we'll explore how to leverage mail-merging variables to create dynamic and data-rich forms.

The Magic of {{record}}

At the heart of our mail-merging system is the {{record}} property enclosed in double curly braces. This simple syntax unlocks a world of possibilities, allowing you to merge data seamlessly into your forms. The two curly braces are crucial, as they signal the start and end of a mail-merging variable.

Basic Usage

To merge a field from the current record, simply use the {{record.FieldName}} syntax. For example, {{record.FirstName}} will dynamically insert the first name from the current record.

Unlimited Traversal

Our system supports unlimited levels of field traversal. This means you can nest fields within fields to access related data effortlessly. For example, {{record.Account.Owner.Name}} will retrieve the name of the owner of the associated account.

Child Relationships

But we don't stop at simple fields. You can also merge data from related records using child relationships. Here's how it works:

In this example, we're iterating through child cases related to the current record and merging the subject, description, and even the first name of the context record into the form. This feature is incredibly handy when you need to create lists or tables of related data.

{{#record.Cases}}
{{Subject}}
{{Description}}
{{record.FirstName}}
{{/record.Cases}}

Dynamic Loading

We understand that form performance is crucial. That's why we've implemented dynamic loading of fields and child objects. Only the data requested by the form is loaded, ensuring optimal performance and minimal overhead.

Inverted Selections for Conditionals

Conditional statements are a breeze with our mail-merging system. You can create inverted selections like this:

{{#record.Cases}}<b>{{Subject}}</b>{{/record.Cases}}
{{^record.Cases}}No cases found{{/record.Cases}}

In this example, if there are cases related to the current record, their subjects will be bolded. If no cases are found, the message "No cases found" will be displayed. This powerful conditional logic allows you to customize your forms based on the presence or absence of data.

Practical Applications

The possibilities with mail-merging variables are virtually limitless. You can use them to create mail-merge templates for contracts, invoices, timesheets, and more. Additionally, this feature enables advanced functionality such as relative record navigation, repeat blocks, and much more.

Conclusion

Mail-merging variables in 3B Forms v4 empower administrators to create dynamic, data-rich forms without the need for complex development. With a simple syntax and support for unlimited field traversal, child relationships, and inverted selections, you can take your forms to the next level. Whether you're automating document generation or building intricate data-driven forms, our mail-merging feature simplifies the process and offers endless possibilities.

Start using mail-merging variables today and elevate your form-building experience to new heights!