Formula URL parameters

Prev Next

Formula URL parameters—what's behind the button?

Two formula fields on the table that holds your master records run Package Builder. Both use the same parameters to say which record to build the package for, which templates to run and in what order, and where to write the result. The installation wizard creates both fields for you (see Package Builder overview); this article explains every parameter so you can change them or build your own.

Where the parameters go

Field

Type

What it does

Process Package (Progress Bar)

Formula - Text, with Allow some HTML tags

Shows the Process Package button. It opens your Package Builder URL in a pop-up progress window, with the parameters joined by & and Base64-encoded into a single request parameter. See Run a package from a button.

Package Builder Batch Arguments

Formula - Text

Holds the same parameters separated by spaces, with no URL. An email notification that you create sends it to the Package Builder request address to run the package in the background. See Run a package in the background.

How parameters are written

  • Separators—in the button formula, parameters are joined with & (for example clientid=Q#&appid=...). In batch arguments, they are separated by spaces and there is no URL.

  • Names are not case-sensitive—PCKGSQ= and pckgsq= mean the same thing. Values keep their case, and a batch configuration compares values exactly.

  • An empty value is the same as leaving the parameter out—apptoken= with nothing after the = passes no app token. If a required parameter's value comes from a field that's empty on this record (for example an empty template sequence), the parameter counts as missing.

  • No & inside a value (button)—Package Builder splits the button's parameter string at every &, so a value that contains one is cut short and the rest is read as a new parameter. Keep & out of values, including field values you insert into rpkeyval or rpaqry.

  • Quote values that contain spaces (batch)—batch arguments are split at spaces, so wrap a value with spaces in double quotes: rpaqry="{'6'.EX.'Final Package'}". In a formula, escape the quotes: & " rpaqry=\"{'6'.EX.'Final Package'}\"".

  • Unknown names are ignored—a misspelled parameter name doesn't cause an error; it just has no effect. If a setting doesn't seem to apply, check the spelling first.

Required parameters

Every run needs clientid, appid, dbid, msid, tpdbid, pckgsq, and stsfid. Repository mode also needs rpdbid, rprelfid, and rpfafid. Background runs also need configid and type.

If a required parameter is missing, no documents are created. From the button, the progress window shows The parameters are invalid. Please contact your app administrator. In the background, the run doesn't start. See Package Builder messages and troubleshooting.

To find your Client ID, a table's ID, or a field's ID, see Find your Client ID, table IDs, and field IDs.

Each step's own batch configuration

These parameters are Package Builder's own. Each step's arguments—the field named in the template's Arguments FID—are separate, and they're checked separately. Batch configuration checking is on for every account, and each step runs its extension in batch, from the button as well as in the background. So each step's arguments must:

  • include configid=<that extension's Config Key>—not Package Builder's

  • pass that extension's own batch configuration. The configurations that the Exact Forms Plus, XL Docs, and PDF Stamper wizards create allow only that wizard's output field in faid, only empty merge options (mrgdbid, mrgfa, mrgkeyfid), and only the wizard's repository table, or an empty value, in rpdbid and rpfafid.

If you change a step's faid, or add repository or merge options to a step, update that extension's configuration in the Batch Config Portal first. See Each step's own batch configuration, Create and manage batch configurations, and Use a configuration in batch runs.

Parameter reference

The following table lists every parameter, grouped by purpose. Samples are written for the button formula; in batch arguments, start each parameter with a space instead of & (for example " pckgsq="). Unless a row says otherwise, a parameter works the same in both.

Parameter

Description

Sample in formula

Authorization and core parameters—identify the account and app, the master record, and where the result is written.

clientid

Required. Your Quickbase Extensions Client ID, assigned to your account during setup. The leading Q is optional. See Find your Client ID, table IDs, and field IDs.

"clientid=Q#"

appid

Required. The ID of the Quickbase app. Used to confirm the app is authorized to use Package Builder.

"&appid=" & AppID()

apptoken

Optional. If your app requires application tokens, pass a token here. Package Builder uses it when it reads the master record and updates the status field. The wizard adds apptoken= with no value; leave it empty if your app doesn't require tokens. Each step's own arguments carry their own app token for that extension.

"&apptoken=[Your App Token]"

dbid

Required. The ID of the master table—the table that holds the master record. Package Builder reads each step's arguments field and writes the status field on this table. Use the built-in function Dbid() when the button is on the master table. With the enhanced security button, data-temptokendbid must name the same table as dbid, because the temporary token is checked against this table and the msid record.

"&dbid=" & Dbid()

msid

Required. The Record ID# of the master record—the record the package is built for. Each step runs with the arguments in this record's fields.

"&msid=" & [Record ID#]

tpdbid

Required. The ID of the Document Templates table that holds the package's templates. Use the table alias instead of typing the table ID.

"&tpdbid=" & [_DBID_DOCUMENT_TEMPLATES]

stsfid

Required. The field ID of the Package Builder Status text field on the master table. When the run ends, Package Builder writes the result and the time here—for example Process Successfully Completed on 10/6/2026 2:15:07 PM—and a line for each step that failed. See Run details and status.

"&stsfid=12"

Process parameters—which templates run, in what order, and whether a merge step is added. See Set up a package.

pckgsq

Required. Package sequence. The Record ID#s of the Document Templates records to run, separated by periods, in the order they run. List every step: extension templates, a PDF Merger template if you merge with one, and (in repository mode) Static Document and Dynamic Document templates.

If a step fails, the package stops there—unless the step is not required. To make a step not required, add :u after its Record ID# (4.3:u.1.2 makes template 3 not required), or check Not Required in Package on the template record. Either one is enough. The u can be upper or lower case, so :U works too. A step that isn't required can fail and the package carries on; the failure is noted in the status field.

The wizard points this parameter at the Package Builder Template Sequence field, so you can set the order there without editing the button.

"&pckgsq=" & [Package Builder Template Sequence]

"&pckgsq=4.3:u.1.2"

mergeargsfid

Optional. Merge arguments field ID. The field ID of a PDF Merger arguments field on the master table, such as PDF Merger Parameters. Package Builder adds a final step that runs PDF Merger with those arguments after the last template in the sequence. In the progress window, this step is named Document Merge and its Template # is N/A. Use it instead of adding a PDF Merger template to the sequence. If the last template in the sequence already uses this same arguments field, no extra step is added, so the merge doesn't run twice. See Merge a package into one PDF.

"&mergeargsfid=60"

Repository mode parameters—store each document in the package as its own record in a child table. Advanced; the installation wizard doesn't add these. See Repository mode.

rpmode

Optional. Repository mode. y or true (upper or lower case) turns on repository mode. Any other value, or leaving it out, runs in regular mode. Static Document and Dynamic Document steps work only in repository mode. This is Package Builder's own rpmode; XL Docs and the other extensions use a different rpmode (a or u) in their own arguments.

"&rpmode=y"

rpdbid

Required in repository mode. The ID of the repository table—the child table of the master table that holds the package's documents.

"&rpdbid=" & [_DBID_PACKAGE_DOCUMENTS]

rprelfid

Required in repository mode. The field ID, in the repository table, of the reference field that relates each record to the master record. Package Builder fills it in on the records it adds, and uses it to find the master record's existing records to delete.

"&rprelfid=6"

rpfafid

Required in repository mode. The field ID of the file attachment field in the repository table. Static Document and Dynamic Document steps save their file here.

"&rpfafid=8"

rpkeyval

Optional. Repository key value. The value of the master table's key field. Use it only if the relationship between the repository table and the master table uses a key field other than Record ID#. Defaults to the msid value.

"&rpkeyval=" & [Project ID]

rpaqry

Optional. Repository additional query. A Quickbase query that limits which of the master record's repository records are deleted: only records that are related to the master record and match this query are deleted. For example, to keep any record with checkbox field 15 checked, delete only the unchecked ones with {'15'.EX.'0'}. Don't use & in the query.

"&rpaqry={'15'.EX.'0'}"

rppurgemode

Optional. Repository purge mode—when to delete the master record's existing repository records:

before (default)—before the first step runs, so each run starts with an empty set.

after—after the last step.

both—before and after.

Any other value, such as none—never delete.

"&rppurgemode=before"

"&rppurgemode=none"

Run Details parameters—add a record for each step to a Run Details table. Records are added only when rddbid, rdrelfid, rdadnfid, and rdntsfid are all set. See Run details and status.

rddbid

The ID of the Run Details table. The wizard creates one named Package Builder Run Details.

"&rddbid=" & [_DBID_PACKAGE_BUILDER_RUN_DETAILS]

rdrelfid

The field ID, in the Run Details table, of the reference field that relates each record to the master record (the wizard names it Related plus your table name).

"&rdrelfid=6"

rdadnfid

The field ID, in the Run Details table, for the name of the extension that ran (the wizard's Addon ran field).

"&rdadnfid=8"

rdntsfid

The field ID, in the Run Details table, for the process details (the wizard's Process Details field): when the step started and finished, how long it took, and the arguments it ran with. Because the arguments are recorded, anything in them—such as an app token—appears in this table. Limit who can view it.

"&rdntsfid=7"

rdnumfid

Optional. The field ID, in the Run Details table, for the number of documents a step created. Setting it turns on counting: after each step, Package Builder reads the record or query (msid or msqry), the table (dbid or msdb), and apptoken from that step's arguments and counts the matching records. The count may not match the documents actually created, and counting adds extra reads, so use it only if you need it. The wizard doesn't create this field.

"&rdnumfid=10"

Web-only parameters—used only by the button and its progress window.

request

The whole parameter string (clientid=Q#&appid=...), Base64-encoded, as a single parameter. The wizard's button always uses it. You can instead list the parameters directly after the ? in the URL.

"?request=" & Base64Encode($params)

showdetails

Optional. Whether the Details table (the list of steps with their status, template, Template #, document type, and process time) is expanded when the progress window opens. Use true (default) or false. The user can expand or collapse it either way.

"&showdetails=false"

Batch-only parameters—used only in the batch arguments for background runs.

configid

Required for background runs. The full Config Key of Package Builder's batch configuration (configkey is accepted as another name for it). Every parameter that the configuration lists must match one of its allowed values exactly—values are case-sensitive. The wizard creates a configuration with clientid and appid and adds configid= for you. If the configuration is missing or a value doesn't match, no documents are created and the message is written to the status field. The button doesn't check Package Builder's configuration, but each step's own arguments need their extension's configid= either way (see Each step's own batch configuration). See Use a configuration in batch runs.

" configid=<your Config Key>"

type

Required for background runs. Tells the request address that the request is for Package Builder. Use the value that matches the address your email notification sends to:

packagebuilder—packagebuilder@mail.quickbasetools1.com (US).

packagebuildereu—packagebuildereu@mail.quickbasetools.com (EU).

" type=packagebuilder"

" type=packagebuildereu"

Warning

In repository mode, Package Builder deletes records by default. Before each run, it deletes every record in the repository table that's related to the master record (and matches rpaqry, if set). Don't keep files you need in the repository table, or set rpaqry or rppurgemode=none to protect them.

Examples

Process Package button (progress window)

A Formula - Text field with Allow some HTML tags turned on. This is the button the installation wizard creates, with Run Details turned on. The OpenAsPopup class opens a pop-up window, and POSTTempToken with data-temptokendbid posts a temporary token for enhanced security. When the template sequence is empty, the field shows a reminder instead of the button.

var text params = "clientid=Q#"  // your Client ID
& "&appid=" & AppID()
& "&dbid=" & Dbid()
& "&msid=" & [Record ID#]
& "&tpdbid=" & [_DBID_DOCUMENT_TEMPLATES]
& "&apptoken="  // add your app token if your app requires one
& "&pckgsq=" & [Package Builder Template Sequence]  // period-delimited template Record ID#s, in run order
& "&stsfid=12"  // Package Builder Status
& "&rddbid=" & [_DBID_PACKAGE_BUILDER_RUN_DETAILS]
& "&rdrelfid=6"  // Related field in Package Builder Run Details
& "&rdadnfid=8"  // Addon ran
& "&rdntsfid=7";  // Process Details

var text url = "https://...?request="  // your Package Builder server URL, created by the installation wizard
& Base64Encode($params);

If(Trim([Package Builder Template Sequence]) = "",
  "<b>Template List not set. Please finish the setup for this Package Builder.</b>",
  "<a class='Vibrant Success OpenAsPopup POSTTempToken' data-height=800 data-width=1100 data-refresh=true data-temptokendbid='" & Dbid() & "' href=\"" & $url & "\">Process Package</a>"
)

Replace https://... with your designated Package Builder URL, and the field IDs with the ones in your app. To merge the package into one PDF without a PDF Merger template, add & "&mergeargsfid=60" with the field ID of your PDF Merger arguments field. To keep the Details table collapsed, add & "&showdetails=false".

Package Builder Batch Arguments (background)

A Formula - Text field. An email notification sends its value to the Package Builder request address. Parameters are separated by spaces, and there's no URL.

"clientid=Q#"  // your Client ID
& " appid=" & AppID()
& " dbid=" & Dbid()
& " msid=" & [Record ID#]
& " tpdbid=" & [_DBID_DOCUMENT_TEMPLATES]
& " apptoken="  // add your app token if your app requires one
& " pckgsq=" & [Package Builder Template Sequence]
& " stsfid=12"  // Package Builder Status
& " rddbid=" & [_DBID_PACKAGE_BUILDER_RUN_DETAILS]
& " rdrelfid=6"
& " rdadnfid=8"
& " rdntsfid=7"
& " configid=<your Config Key>"  // added by the installation wizard; see the Batch Config Portal
& " type=packagebuilder"  // EU accounts: type=packagebuildereu

On a record, the value looks like this:

clientid=Q# appid=bxxxxxxxx dbid=bxxxxxxxx msid=22 tpdbid=bxxxxxxxx apptoken= pckgsq=4.3.1.2 stsfid=12 rddbid=bxxxxxxxx rdrelfid=6 rdadnfid=8 rdntsfid=7 configid=<your Config Key> type=packagebuilder

If you change a parameter that the batch configuration lists (by default clientid and appid), update the configuration's allowed values first, or the next run stops with a mismatch message.

Repository mode additions

Add these lines to either formula to store each document as a record in a repository table. In the button formula use &, as shown; in batch arguments use a space instead.

& "&rpmode=y"
& "&rpdbid=" & [_DBID_PACKAGE_DOCUMENTS]  // your repository table
& "&rprelfid=6"  // reference field to the master record
& "&rpfafid=8"  // file attachment field
& "&rppurgemode=before"  // default: delete this record's repository records before the run

Each step's own arguments also need that extension's repository options, which its batch configuration must allow. See Repository mode for how to set up the repository table and the steps.