Making Forms Repeat Dynamically

Make it so that (x) assets or (x) services = (x) copies of a form, automatically.

Written by Aaron Shoemaker Updated over a week ago

Using Adobe Acrobat Pro DC (and possibly other PDF editors) it is possible to add custom metadata directly into the PDF document itself that drives the number of copies of forms that will show up on a given job. This method is meant to be used in conjunction with blank paperwork rules in order to further automate forms.

This article will cover two specific ways to do this, which will result in extra copies of paperwork being generated automatically based on either the number of services or assets on a given appointment.

IMPORTANT: You can make paperwork repeat based on the services or on assets, but not both. If you choose to repeat a document for every asset, you cannot also make it repeat for every asset (or vice versa).

To make the necessary edits using Adobe Acrobat Pro DC:

1. With the PDF you want to add the custom metadata into open in Acrobat, go to File > Properties

2. Then, go to the "Custom" tab in the "Properties" window.

3. The image above shows the "Custom" tab open in the PDF Properties modal window. Note that in order for this to work correctly, you need to enter the rules in both the Name and Value custom fields without any punctuation (specifically, do not include the colons, commas, or double-quotes that eventually appear in the JSON metadata -- these will be handled correctly if you enter your custom field values sans punctuation -- if you do add any punctuation, it will appear redundantly in the JSON metadata and will not function correctly).

4. To generate a copy of a form for each service on an appointment, edit the "Name" field to contain the exact string "repeatService". Edit the "Value" field to contain the string "true".

5. For forms where there are multiple rows for tracking multiple assets on the same page, and you want the form to duplicate whenever the total number of assets to-be-filled exceeds the number of rows on the page, you will need to enter two "Name" | "Value" pairs.

First, you will need to define the asset type that is being tracked in the form. In the "Name" field, enter the string "repeatAsset" -- in the "Value" field, enter the asset type: Ex. - "backflow", "alarm_device", etc. You must use exact values for asset type from the below table.

Second, you will need to indicate after what quantity of assets the form will generate an additional copy. This value will just be the number of rows on the form in almost all cases. To do this, for your second custom "Name" | "Value" pairing, in the "Name" field, enter the string "repeatAssetDivisor". In the "Value" field, enter the number (integer) that the form should repeat on. (Ex. - on a form with 25 rows of fillable asset fields, the "repeatAssetDivisor" value would be 25).

To repeat sub-assets underneath a parent asset, use "repeatAsset" for the parent asset type and "repeatSubasset" and "repeatSubassetDivisor" for the subasset type. You cannot use "repeatSubassetDivisor" and "repeatAssetDivisor" rules on the same blank paperwork file -- that is, if you want to have multiple rows for a set of sub-assets on a fillable form, you can only do so for one parent asset per page. If you provide both, the "repeatAssetDivisor" value that you provided will be ignored, and 1 will be used instead. See this article for more information about using sub-assets on fillable blank paperwork.