Setting Up Batch

Prev Next

Set up batch

The PDF Stamper Batch Processor creates documents in the background instead of in a browser tab. Use it when you want documents created automatically (for example, when a record is saved), when you want one click to create documents for many records, or when you want the stamped documents merged into a single PDF. You start it with an email notification: a record change sends the batch arguments to a dedicated email address, and PDF Stamper stamps the documents and saves them.

If you used the installation wizard and chose a setup that includes batch, the wizard already created the fields and tables below. Use this page to understand what each piece does, to build the setup by hand, or to add the advanced options. For the wizard, see PDF Stamper setup type and PDF Stamper finish.

Set up a Quickbase app to use PDF Stamper Batch Processor

Application Setup

PDF Stamper should already be set up in the app that will use the Batch Processor, including the Document Templates and Document Subtables tables.

Basic Setup:

  1. Create or use an existing table that will be designated as the Batch table. The Batch table is the table the batch process is executed from. In a wizard bulk setup, this is the PDF Stamper Batch Processing table.

  2. The Batch table needs three fields to control the process. The names below are the ones the wizard creates in a bulk setup.

    Field

    Type

    What it does

    Execute Batch

    Formula - URL (button)

    Sets the trigger field to Batch Execution Requested_ followed by the date and time. That change fires the email notification. The wizard hides the button while a request is pending (while the trigger field contains Requested).

    Trigger Field

    Text

    Holds the request, and later the result. When the run finishes, PDF Stamper replaces its value with PROCESS COMPLETED_ followed by the date and time. The field's ID is passed as pdftfid.

    Batch Processing Arguments

    Formula - Text

    The parameters for the run. The email notification sends this field's value to the batch address. See The batch arguments.

  3. Create an email notification from the Batch table that sends the batch arguments field to the email address dedicated to the PDF Stamper Batch Process:

    • pdfstamper@pdfstamper.quickbasetools.com for US accounts

    • pdfstampereu@pdfstamper.quickbasetools.com for EU accounts

The batch arguments

The batch arguments field is a formula that builds one line of name=value parameters. There needs to be a space between each parameter, and if you have a space in the value, surround the value in “quotes“.

All parameters that can go in the batch arguments field are listed in PDF Stamper formula URL parameters.

Optional Setup:

PDF Stamper Batch Processor can also log each batch request in a separate table. This isn't required. It lets you see:

  • How often the process runs.

  • How many documents are created in each request.

  • How long each request takes to complete.

Additional Setup:

  1. Create an Activity table to store the batch request activity. The wizard names it PDF Stamper Batch Processing Logs.

  2. Create a relationship between the Batch table and the Activity table.

  3. Add these fields to the Activity table. PDF Stamper saves each value by field name, so use these names exactly.

    Field

    What PDF Stamper saves

    Related Document Generation

    The Record ID# of the Batch table record that ran the batch. This is the relationship to the Batch table.

    Start

    When the run started.

    End

    When the run ended.

    Documents Processed

    The number of documents created.

    Status

    Completed.

  4. Add these parameters to the batch arguments: pdfadbid (the Activity table), pdfbdbid (the Batch table, usually Dbid()), pdfbrid (the Batch table record's Record ID#), and pdftfid (the trigger field). PDF Stamper adds an Activity record only when a run finishes without an error.

Advanced Setups

Multi-Record Transaction Setup:

The Batch Processor can create a document for many records at once. To set this up:

  1. Decide which records you want documents for.

  2. Create a report that holds all of those records, or build a query that finds them. A query uses the Quickbase API format: for example, msqry={'10'.EX.'Active'} creates a document for each master table record that has the value Active in field 10.

  3. Add msqid (the ID of the report) or msqry (the query) to the batch arguments. Use one of them, not both. Both are described under Multi-Record Transaction Parameters in PDF Stamper formula URL parameters.

Merge Setup:

With a Multi-Record Transaction, PDF Stamper can merge all of the documents it creates into one PDF after they're generated. To set this up:

  1. Add a file attachment field to the table you want to store the merged file in. The wizard creates Merged File on the Batch table.

  2. Add these parameters to the batch arguments:

    Parameter

    What it does

    Sample

    mrgdbid

    The table the merged PDF is saved in.

    mrgdbid=dbid()

    mrgrid

    The Record ID# of the record the merged PDF is saved in.

    mrgrid=[Record ID#]

    mrgfa

    The file attachment field ID the merged PDF is saved in.

    mrgfa=10

    mrgfn

    The name of the merged PDF file.

    mrgfn=allpdfs

Running From Another Table:

You can run the Batch Processor from a table other than the Batch table. For example, a master record can create a PDF document for each of its related child records.

  1. Add the batch arguments field to the table that runs the batch.

    • If you use msqry, write the query so the related field in the child table is compared to the key field of the master record.

    • Change the values of parameters that depend on the table, such as msdb, faid, and the field IDs. If your batch configuration lists allowed values for them, add the new values there too. See Create and manage batch configurations.

  2. Create the email notification on that table, to send its batch arguments.

If something goes wrong

The Batch Processor doesn't write error messages to your app. If a run doesn't finish, see PDF Stamper troubleshooting.