Take the end-user's "overflow" text and automatically add it to addendum

October 28, 2020
Not enough space on a PDF field for long text? Automatically take "overflow" text and add it to an addendum.

Download this recipe to see how it works.

This solution allows you to conditionally create an addendum to your PDF that contains "overflow" text that can't fit on small PDF fields. If the end-user's input doesn't fit on the field, the sentence "Check addendum" is written in the PDF field and an addendum is automatically attached to the Block where you provide the original PDF.

How it works

Imagine you have a long text question that defines a variable, like so: 

What you want to do is figure out whether this variable (potentially_long_answer) is greater than or equal to a certain number of characters (whatever number you believe the PDF's field can handle).

Step 1

Use an Expression Block (which allows you to create a variable with an expression editor) to create a variable that is equal to the number of characters in your long text question variable: 

The operator 'character length' counts the number of characters in a piece of text

Step 2

Now that you have a variable that is equal to the number of characters in your long text variable, it's time to figure out whether that number is more than the PDF field can handle. This variable (which I am calling should_overflow) is what will determine whether or not we take the end-user's input and transport it to an addendum instead of adding to a too small PDF field.

This expression is evaluating two numeric values. The first is the number of characters in my long text variable, the other numeric value is the limit of characters I believe the PDF field can handle

Step 3

Now you need to create the variable that is ultimately added to the PDF field. This variable will either equal the end user's input or the sentence "Check the addendum" depending on how many characters are in the end-user's input.

This is a perfect use-case for a Conditional Block:

This variable (answer_to_show_in_main_document) is either equal to "Check the addendum" or the end-user's input to the long text field depending on the value of our should_overflow variable made at Step 2

Add answer_to_show_in_main_document to your PDF on the field that might be too small for the end-user's input.

Last step

Create the addendum. You can use Microsoft Word, but a simple addendum can also be easily built with the Community.lawyer Word editor. On the addendum, simply add the long text question variable (in this example, the variable potentially_long_answer). You may also wish to add headers that explain what PDF field this answer corresponds to.

When you give the addendum to the end-user, make sure to use conditional logic to only provide the addendum if the addendum is necessary in the first place, like so: 

The addendum is only being attached to this Final Block if should_overflow is True (the variable we made at Step 2)

You can duplicate this recipe App to see this example for yourself in the App Builder.

Contact us for support

Talk to a real person, quickly. We're available 9am - 5pm EST.