Formula URL parameters—what's behind the button?
A Formula - Text field with Allow some HTML tags selected, on the table that holds your parent records, runs Image Resizer/Rotator. The formula builds a URL made of a base address followed by parameters, and wraps it in a button that sends a temporary token (POSTTempToken), as in the example below. The same parameters are used by the API and by batch processing.
A Formula - URL field also works for the button if its POST temporary token check box is selected—see POST temporary token from a Quickbase field. If that option is off, accounts that use enhanced security show A temporary authorization token is required for this application. Please check your field settings or contact an App Administrator.
Base address—.../ImageResizer.aspx? to resize or .../RotateImage.aspx? to rotate. Replace https://... with your designated Image Resizer/Rotator server URL. [PLACEHOLDER: where to get your Client ID and server URL — revisit after the wizard setup for Image Resizer/Rotator ships]
Separators—in a button formula, parameters are joined with &. In batch arguments, they are separated by spaces and there is no base address.
Lists—parameters that end in list take a period-separated list of field IDs (FIDs), one per image in clist and in the same order. If a list has a different number of entries than clist, the request stops before any images are processed. (The Amazon S3 lists work differently—see Process images stored in Amazon S3.)
Parameter names are not case-sensitive.
The following table lists each parameter.
Parameter | Description | Sample in formula |
|---|---|---|
Authorization parameters—identify the account and application running Image Resizer/Rotator. | ||
clientid | Required. Your Quickbase Extensions Client ID: Q followed by a number, for example Q1234. [PLACEHOLDER: where to get your Client ID and server URL — revisit after the wizard setup for Image Resizer/Rotator ships] | "clientid=Q#" |
appid | Required. The ID of the Quickbase application. Used to confirm the application is authorized to use Image Resizer/Rotator. | "&appid=" & AppID() |
Record parameters—identify the record the button is on. | ||
dbid | Required. The ID of the table the record is in. msdb and msdbid are accepted as alternative names. | "&dbid=" & Dbid() |
recid | Required. The Record ID# of the record with the button. For one record, it's the record whose images are processed. With query, the images come from the query instead, but keep recid: it's required whenever you use triggerfid, because the status is written to this record. rid and msid are accepted as alternative names. | "&recid=" & [Record ID#] |
Image field parameters—which images to process and where results go. See Track and store results. | ||
clist | Required. Period-separated list of the file attachment FIDs holding the images. When rotating, each FID can be followed by a colon and the FID of a field holding that image's rotation amount (for example, 14:40). | "&clist=14.15" "&clist=14:40.15:41" |
falist | Optional. File attachment FIDs to save each processed image to, one per clist image. If omitted, the original image is replaced. | "&falist=20.21" |
updatefidlist | Optional. Checkbox FIDs that are checked when each image is processed. | "&updatefidlist=16.17" |
datefidlist | Optional. Date/Time FIDs set to the date and time each image is processed. | "&datefidlist=18.19" |
currfsfidlist | Optional. Text FIDs that receive each image's original file size (for example, 130.96 KB). | "&currfsfidlist=30.31" |
newfsfidlist | Optional. Text FIDs that receive each image's new file size. | "&newfsfidlist=32.33" |
Resize parameters—supply one method. If more than one is supplied, the first in this order is used: rsrate, then width/height, then rsfilesize, then fsrate. See Resize images. | ||
width | New width in pixels. If height is omitted, the height is calculated to keep the image's proportions. | "&width=" & [New Width] |
height | New height in pixels. If width is omitted, the width is calculated to keep the image's proportions. If both are supplied, the image is resized to exactly that width and height. | "&height=" & [New Height] |
rsrate | Percentage to change each dimension by. 1–99 shrinks the image by that percentage (25 makes each side 75% of its original size; 50 halves it). Over 100 enlarges it by that percentage (150 makes each side 250% of original). A % sign is optional. 100 is not valid. | "&rsrate=" & [Resize Rate] |
rsfilesize | Target file size; the image is resized to be at or under this size. Use with fsunit. Decimals are allowed. The smallest target is 1 KB. | "&rsfilesize=250" |
fsunit | Unit for rsfilesize: KB or MB. If omitted (or any other value), rsfilesize is read as bytes. | "&fsunit=KB" |
fsrate | Percentage to reduce the file size by, from 1 to 99. 50 aims for about half the original file size. A % sign is optional. | "&fsrate=50" |
Rotate parameters—used with the RotateImage.aspx address. See Rotate images. | ||
rotateval | Degrees to rotate every image clockwise: 0, 90, 180, or 270. A number followed by degrees (for example, 90 degrees) also works. Any other value—including Do not rotate—is an error; use 0 for no rotation. Overrides any rotation field in clist. A rotate button needs either rotateval or rotation fields in clist; if rotateval reads from a field that's blank and clist has no rotation fields, the result is an error. | "&rotateval=90" "&rotateval=" & [Rotate Value] |
Multiple-record parameters—process images on related records. See Process images across multiple records. | ||
query | A Quickbase query that selects the records whose images are processed, instead of the recid record. Keep recid in the formula for the record with the button. Up to 50 records per button or API request. | "&query={'39'.EX.'" & [Record ID#] & "'}" |
querydbid | The ID of the table the query runs against. Defaults to dbid. | "&querydbid=" & [_DBID_FILES] |
Status and batch parameters—see Batch processing. | ||
triggerfid | Optional. FID of a text field on the record with the button (the dbid table and the recid record) that shows progress: Processing Images... while running, then Batch_Process_Completed_<date and time> or Batch_Process_Failed_<date and time>: followed by the error messages. Requires recid, also with query. Required for batch processing. | "&triggerfid=45" |
mode | Batch only. resize or rotate. Buttons and the API take the mode from the address instead. | " mode=resize" |
type | Batch only. Which batch processor to use. Always imageresizer. | " type=imageresizer" |
configid | Batch only, and required for batch runs. The Config Key of a batch configuration for Image Resizer/Rotator. The installation wizard doesn't create one for Image Resizer/Rotator: create the configuration in the Batch Configuration Portal and copy its Config Key—see Use a configuration in batch runs. | " configid=<your Config Key>" |
Amazon S3 parameters—process images stored in Amazon S3 instead of file attachment fields. See Process images stored in Amazon S3. | ||
amazons3 | Set to y to read and write images in Amazon S3. s3 is accepted as an alternative name. | "&amazons3=y" |
s3list | Required for S3. Text FIDs holding each image's S3 object key. | "&s3list=119.121" |
fnlist | Required for S3. Text FIDs holding each image's file name, one per s3list entry. | "&fnlist=120.122" |
rslist | S3 resize. Resize percentages (values, not FIDs), one per image. Same meaning as rsrate. Whole numbers only, with no % sign. | "&rslist=50.25" |
rtlist | S3 rotate. FIDs of fields holding each image's rotation amount. | "&rtlist=130.131" |
s3bucket | Optional. Uses this bucket instead of the default bucket saved with your account. | "&s3bucket=" & [S3 Bucket] |
s3secretaccesskey | Optional. Uses this secret access key instead of the one saved with your account. Not recommended: anyone who can view the formula, or the button's link, can read the secret. Rely on your saved credentials instead. | "&s3secretaccesskey=..." |
Before and after actions—run a Quickbase API call on the record before or after the images are processed. See Run a Quickbase API call before or after processing. | ||
preqbaction | Optional. A Quickbase API call to run before images are processed, wrapped in Base64Encode(). | "&preqbaction=" & Base64Encode(URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid_50=Started") |
postqbaction | Optional, buttons only. A Quickbase API call to run after images are processed, wrapped in Base64Encode(). Requires the enhanced security button (POSTTempToken). | "&postqbaction=" & Base64Encode(URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid_51=Done") |
Example
This button resizes the images in fields 14 and 15 to the width and height on the record, saves the results to fields 56 and 57, checks fields 18 and 19, and sets fields 32 and 33 to the date and time:
var text url = "https://.../ImageResizer.aspx?" // your Image Resizer/Rotator server URL
& "clientid=Q#" // your Client ID
& "&appid=" & AppID()
& "&dbid=" & Dbid()
& "&recid=" & [Record ID#]
& "&clist=14.15"
& "&width=" & [New Width]
& "&height=" & [New Height]
& "&falist=56.57"
& "&updatefidlist=18.19"
& "&datefidlist=32.33";
"<a class='Vibrant Success OpenAsPopup POSTTempToken' data-height=400 data-width=800 data-refresh=true data-temptokendbid='" & Dbid() & "' href=\"" & $url & "\">Resize Images</a>"Run a Quickbase API call before or after processing
Use preqbaction and postqbaction to update the record as part of the same click—for example, to set a status field before images are processed, or to stamp a field when they're done. This replaces the older pattern of a button that runs an API call and then redirects (rdr=) to the extension, which doesn't work with Quickbase enhanced security.
Write the API call as a URL to your own realm, built with URLRoot(), for example URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid_50=Started". Don't include an rdr= part.
Wrap it in Base64Encode()—a built-in Quickbase formula function—and pass it as the parameter: & "&preqbaction=" & Base64Encode( ... ).
Use the enhanced security button (POSTTempToken and data-temptokendbid, as in the example above). The call runs with the clicking user's permissions.
Example—set field 50 to Resizing before processing and field 51 to the current date and time after:
var text url = "https://.../ImageResizer.aspx?" // your Image Resizer/Rotator server URL
& "clientid=Q#" // your Client ID
& "&appid=" & AppID()
& "&dbid=" & Dbid()
& "&recid=" & [Record ID#]
& "&clist=14.15"
& "&rsrate=50"
& "&preqbaction=" & Base64Encode(URLRoot() & "db/" & Dbid() & "?a=API_EditRecord"
& "&rid=" & [Record ID#] & "&_fid_50=Resizing")
& "&postqbaction=" & Base64Encode(URLRoot() & "db/" & Dbid() & "?a=API_EditRecord"
& "&rid=" & [Record ID#] & "&_fid_51=" & URLEncode(ToText(Now())));
"<a class='Vibrant Success OpenAsPopup POSTTempToken' data-height=400 data-width=800 data-refresh=true data-temptokendbid='" & Dbid() & "' href=\"" & $url & "\">Resize Images</a>"The call must point at your own Quickbase realm. Any other address is rejected with Direct Call's URL is invalid.
The call must act on the same table as the button (Dbid()). Calls to a different table fail—see Security edge cases.
Calls that open a Quickbase page, such as GenAddRecord or GenEditRecord, don't work here.
postqbaction runs for buttons only—not batch processing—and only from the enhanced security button.
If the preqbaction call fails, its error appears in the result window and no images are processed. If the postqbaction call fails, the images have already been processed; its error appears in the result window along with the processing result.
For more on updating buttons for enhanced security, see Change formula fields. For every message a button can show, and what to do, see Image Resizer/Rotator messages and troubleshooting.
We understand these parameters can be complex—submit a technical support case if you have any questions.