Batch processing runs Image Resizer/Rotator in the background, with no window for the user to wait on. A Quickbase email notification sends the processing arguments to the batch processor, which resizes or rotates the images and writes its progress to a field on the record.
Use batch processing to:
Process images automatically—for example, as soon as a photo is uploaded.
Process images across more than 50 records at once (buttons and the API are limited to 50).
Batch processing uses the same parameters as buttons, including query and querydbid for multiple records.
How it works
Something changes on the record—for example, a user clicks a button or another field changes—and the trigger field is updated to contain Requested. (To start when an image is uploaded instead, see Start when an image is uploaded.)
A Quickbase email notification on that table fires and sends the batch processing arguments to the batch processor.
The batch processor sets the trigger field to Processing Images... and processes the images.
When finished, it sets the trigger field to Batch_Process_Completed_ followed by the date and time, or Batch_Process_Failed_ followed by the date and time and each error message.
Step 1: Create the fields
Create these fields on the table that starts the process—the table with the images for one record, or the parent table (for example, Projects) for multiple records:
Field | Type | Purpose |
|---|---|---|
Trigger Field | Text - Multi-line | Starts the process when it contains Requested, then shows progress and errors. Its FID is passed as triggerfid. |
Batch Processing Arguments | Formula - Text | The parameters sent to the batch processor (Step 2). |
Execute Batch (optional) | Formula - Text, with Allow some HTML tags selected | A button that sets the trigger field to request a run (Step 3). Not needed if the process starts when an image is uploaded, or if something else writes Requested to the trigger field. |
Also create any input fields the arguments read from, such as New Width, New Height, or Resize Rate—see Resize images—and any tracking fields from Track and store results.
Step 2: Write the batch processing arguments
The Batch Processing Arguments formula uses the same parameters as a button, with these differences:
There is no base address.
Parameters are separated by spaces instead of &. Don't put spaces anywhere else—for example, write mode=resize, not mode = resize.
Three parameters are added: triggerfid (the trigger field), mode (resize or rotate), and type (always imageresizer).
Always include recid, the record that has the trigger field—also when you use query. The status is written to that record; without recid the trigger field never changes from Requested.
Add configid with the Config Key of a batch configuration for Image Resizer/Rotator. The installation wizard doesn't create a configuration for Image Resizer/Rotator yet, so submit a technical support case to get your first one. Then add configid= with that Config Key—see Use a configuration in batch runs.
Example: resize one record
"clientid=Q#" // your Client ID
& " appid=" & AppID()
& " dbid=" & Dbid()
& " recid=" & [Record ID#]
& " clist=14.15"
& " width=" & [New Width]
& " height=" & [New Height]
& " updatefidlist=18.19"
& " datefidlist=20.21"
& " triggerfid=85" // the Trigger Field
& " mode=resize"
& " type=imageresizer"Example: rotate across multiple records
"clientid=Q#"
& " appid=" & AppID()
& " dbid=" & Dbid()
& " recid=" & [Record ID#] // the record with the Trigger Field
& " query={'39'.EX.'" & [Record ID#] & "'}"
& " querydbid=" & [_DBID_FILES]
& " clist=6.15"
& " rotateval=" & [Rotate Value]
& " triggerfid=85"
& " mode=rotate"
& " type=imageresizer"Add one more line to either example: & " configid=<your Config Key>".
Step 3 (optional): Add an Execute Batch button
This button uses the Quickbase API to write Batch_Process_Requested_ and the current time to the trigger field, which starts the process. While a run is requested and not yet finished, it shows Refresh instead, so users don't start it twice.
var text url = If(Contains([Trigger Field], "Requested") and not(Contains([Trigger Field], "Completed")),
URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & URLEncode([Record ID#]),
URLRoot() & "db/" & Dbid() & "?act=API_EditRecord"
& "&rid=" & URLEncode([Record ID#])
& "&apptoken=[Your App Token]"
& "&_fid_85=Batch_Process_Requested_" & ToText(Now()) // 85 = your Trigger Field
& "&disprec=1");
var text label = If(Contains([Trigger Field], "Requested"), "Refresh", "Process Images");
"<a class='Vibrant Success' href=\"" & $url & "\">" & $label & "</a>"Replace [Your App Token] with an application token from your app's settings, or remove that line if your app doesn't require application tokens. Never publish a real token in shared formulas or documentation.
Important
This button calls the Quickbase API directly from the user's browser, with an application token in the link. Test it in your app before you rely on it. If it doesn't update the trigger field—for example, because of your app's application token or security settings—you don't need the button: any change that writes a value containing Requested to the trigger field starts a run, such as a form rule, a Quickbase Pipeline, a grid edit, or an import. The email notification in Step 4 does the rest.
Step 4: Create the email notification
On the same table, open the table's ⋯ menu, select Notifications, subscriptions & reminders, then select + New Email and choose Notification.
Set Permission type to Open: Emails sent openly to anyone. If your realm doesn't allow open notifications, Quickbase shows a notification error—submit a technical support case to have it enabled.
Give the notification a name, for example Image Resizer/Rotator - Batch.
In Notify whom, enter imageresizer@mail.quickbasetools1.com. You can add other addresses to be told when a run is requested.
Under Notification when, choose a record is modified or added. Under Additional criteria, choose Any of the following fields change and select the Trigger Field, then add the condition Trigger Field contains Requested.
Under Message, choose Custom message. Enter a subject such as Image Resizer/Rotator Batch Request - <your app name>. In the body, insert only the Batch Processing Arguments field (pick it from the field list), with no spaces before or after the square brackets.
Save the notification.
Note
The contains Requested condition is required. The batch processor writes to the trigger field as it runs; without the condition, those updates would fire the notification again and start the process over and over.
Start when an image is uploaded
To process images automatically when they're uploaded, without a button, set up the email notification in Step 4 differently. All three changes are needed:
In Any of the following fields change, select the file attachment fields that hold the images, not the trigger field.
Remove the Trigger Field contains Requested condition. An upload doesn't write Requested, so with the condition the notification never fires.
Save the results to separate file attachment fields with falist, and don't select those fields in step 1. If the processed image is saved back to the field it came from, that save changes the field again, the notification fires again, and the image is processed over and over.
You can still pass triggerfid to see the status on the record; the trigger field isn't watched by this notification, so its updates don't start new runs.
If nothing happens
Check that the notification is Open, sends to the batch address, and that its message body contains only the arguments field.
If the trigger field stays at Batch_Process_Requested_…, check that the arguments include recid, and that clientid, appid, and configid are correct. A run that stops before processing—for example, because the app isn't authorized or the batch configuration doesn't match—doesn't update the trigger field.
For every message and what to do, see Image Resizer/Rotator messages and troubleshooting.