Exact Forms Plus can print a sheet of mailing labels for every record a report or query returns, for example all active customers. It creates one Word or PDF document with all the labels, in the label layout you choose in Word (for example 30 labels per page).
Mailing labels work differently from other Exact Forms Plus documents:
The template uses Word's own mail merge fields, not
~field~tokens.The button usually goes on the template's record in the Document Templates table, not on the table with the addresses.
The setup wizard doesn't set up mailing labels. You add the fields and the button yourself, as described on this page.
Before you start
Exact Forms Plus is set up in the app, so the app has a Document Templates table. See Set up Exact Forms Plus.
You know which table holds the addresses, for example Customers, and its table alias, for example
[_DBID_CUSTOMERS].
Step 1: Prepare the address table
Create an address field (recommended). One formula text field with the whole address makes the template simple. For example, a field named AddressBlock:
List("\n", [Company Name], [Address], List(", ", [City], [State/Province]) & " " & [Postal Code])Create a report with the records you want labels for, for example customers with Status = Active. Add the address field as a column. Save it, then note the report's ID: it's the number after
qid=in the browser's address bar.
Instead of a report, you can pick the records with a Quickbase query in the button (msqry).
Step 2: Create the label template in Word
Word needs a sample list to insert merge fields, so start with a small spreadsheet.
Export the report from Step 1 to a CSV file, and open it in Excel. Keep the header row and one or two records. Save it as an Excel file.
In Word, create a blank document. On the Mailings tab, select Start Mail Merge > Labels, and choose your label vendor and product number.
Select Select Recipients > Use an Existing List, and choose the Excel file.
Click in the first label and select Insert Merge Field. Choose your address field. Add any other fields or text you want on each label.
Right-click each merge field, select Edit Field, select Preserve formatting during updates, and select OK.
Select Update Labels to copy the first label to all labels on the page.
Right-click each «Next Record» field, select Edit Field, select Preserve formatting during updates, and select OK.
Select Start Mail Merge > Normal Word Document. This disconnects the Excel file but keeps the merge fields.
Save the document as .docx.
Exact Forms Plus fills each merge field with the Quickbase field that has the same name. Word turns spaces in column names into underscores, so field names without spaces or special characters, like AddressBlock, are the safest.
The labels use the fonts and spacing of the template. Format the first label before step 6.
Step 3: Add the template to Quickbase
In the Document Templates table, add a record. Give it a Name, for example Customer labels.
Upload the Word file to Template File.
In clist, enter the field IDs of the address table's fields that the labels use, separated by periods, for example
3.25. You can also select them with the EFP Configurator. If the button uses a report (msqid), the clist is optional: the report's columns are used.Save the record, and note its Record ID#.
Step 4: Add the fields for the labels
In the Document Templates table, add these fields:
Field | Type | Purpose |
|---|---|---|
Mailing Labels | File attachment | Stores the labels document. |
Mailing Labels Date | Date/time | Optional. When the labels were last created. |
Mailing Label Template | Checkbox | Optional. Lets you use a form rule to show the label fields only on label templates. |
Create Mailing Labels | Formula rich text | The button. See Step 5. |
Put Create Mailing Labels and Mailing Labels on the form for viewing and editing.
Step 5: Create the button
Copy the start of the URL (up to .aspx?) from your Generate EFP Document button, and replace doc_merge_ua.aspx with doc_maillabels_UA.aspx. Then use this formula for Create Mailing Labels, with your own IDs:
var Text url = "https://<your Exact Forms Plus address>/doc_maillabels_UA.aspx?"
& "request="
& Base64Encode("clientid=Q1234"
& "&appid=" & AppID()
&"&tpdbid=" & Dbid()
&"&tpid=" & [Record ID#]
&"&msdb=" & [_DBID_CUSTOMERS]
&"&msqid=12"
& "&mrgfn=Customer Labels"
& "&docfmt=pdf"
& "&mrgdbid=" & Dbid()
&"&mrgrid=" & [Record ID#]
&"&mrgfa=8"
& "&mrgdte=9"
);
"<a class='Vibrant Blue OpenAsPopup POSTTempToken' data-height=600 data-width=800 data-refresh=true data-tempTokenDBID='" & Dbid() & "' href=\"" & $url & "\">Create Mailing Labels</a>"Parameter | What it does |
|---|---|
| The same as on your other Exact Forms Plus buttons. Required. |
| The template record. On a button in the Document Templates table, use |
| The table with the addresses. Use its table alias. Required. |
| Which records get labels: the report ID from Step 1 ( |
| File name for the labels document, without the extension. Required. |
|
|
| Where to save the labels: table, Record ID#, and file attachment field (Mailing Labels). Leave out |
| Optional. The Mailing Labels Date field. |
| Optional. Overrides the clist on the template record. |
The labels always open in the browser when they're ready: a PDF opens in the window, and a Word file downloads. They're also saved to Mailing Labels if you set mrgfa.
One run creates up to 100 times your account's per-run document limit, which is 5,000 labels with the default limit of 50.
Step 6: Try it
Open the template record and select Create Mailing Labels.
Check the labels that open. Close the window: the record refreshes and Mailing Labels has the file.
Print on your label sheets. Print at 100% (actual size), not "fit to page", so the labels line up.
Print many labels for one record
To print the same label several times, for example 10 labels for one shipment, add num to the URL. Exact Forms Plus takes the first record the report or query returns and repeats it.
To number the labels (Box 1 of 10, Box 2 of 10 …), put ~cnt~ in a Quickbase field that's on the label, for example a formula text field with "~cnt~", and add cnt with the text to show before the number.
Put num and cnt after the Base64Encode() part, as regular URL parameters. They don't work inside it:
var Text url = "https://<your Exact Forms Plus address>/doc_maillabels_UA.aspx?"
& "request="
& Base64Encode( … same as above … )
&"&num=10"
& "&cnt=Box";With a query in msqry, make it return the one record you want, for example {'3'.EX.'" & [Related Shipment] & "'}.
If something goes wrong
What you see | What to check |
|---|---|
InvalidParams_Labels.htm | A required parameter is missing: |
A clist is required. | The button uses |
There were NO Master records returned to process. | The report or query found no records. Check it in Quickbase. |
Labels are blank, or show «AddressBlock» | The merge field's name doesn't match a Quickbase field in the clist or report. Check the spelling, and avoid spaces in the field name. |
Only one label per page is filled in | The «Next Record» fields are missing. Redo Step 2, steps 6 and 7. |
For other errors, see Troubleshooting.