Replacement Rules Overview

A unique feature of our platform is the ability to run find-and-replace actions on the compiled document before the file is saved. We call these “Replacement Rules”.

Replacement Rules can be conditional based on the user’s choices or set to run in all cases.

They are especially useful for:

  • automatic error correction (see here for more detail on this); and
  • reducing the number of named ranges where you have elements that appear many times throughout the document (see this tutorial, which contains a more detailed demonstration).
A classic example is changing content like “he/she” to be just “he” or “she” depending on the user’s choice of gender in the form. You can see that Replacement Rule being built in the image below. Note that you can also use Replacement Rules to change gender-specific language like "he/she has" to gender-neutral language such as "they have".

 

Adding a Replacement Rule

To create a Replacement Rule, start by navigating to the "Replacement Rules" tab. Then hit the “Add” button. From there, you can give your rule a name and then enter the search text (ie, the content to be found) and the replacement text (ie, the content that will be inserted in place of the search text).

Conditional replacement rules

If the Replacement Rule is conditional (ie, it should only run in certain cases), you can easily apply logical rules to the Replacement Rule.  To apply logic to a Replacement Rule, simply choose "No" for "Unconditional".  You can then paste in any logic that you have copied, or click the "Logic Builder" button to access the graphical logic builder.

"Match Case" and "Whole Words Only"

The additional options "Match Case" and "Whole Words Only" mirror the same functionality from the find-and-replace tool in MS Word. In short:

  • "Match Case" will make the find-and-replace function case-sensitive; and
  • "Whole Words Only" will only run the find-and-replace action where the search text is an entire word, rather than part of a word. For example, you might want to change "act" to be "Act" to capitalize the first letter but only where "act" is an entire word on its own, rather than part of another word such as "action".

Order of Operations

The Replacement Rules run in a particular order, being from the top of the list first down to the bottom of the list last.  If the order matters, you can easily control the order by simply dragging the rules up and down in the list, as shown below: