Skip to content

Configuring a Report

The builder is two columns: configuration on the left, output on the right. The output column updates as you type, so the URL and the preview always describe the form as it currently stands.

Cards appear in the left column in the order below. Several are conditional, a control a format cannot express is hidden rather than shown and ignored. JSON returns the whole record, so it has no columns to pick and no rows to collapse, and neither card appears.

Report type and licenses

Pick the endpoint from the Report Type dropdown. Super variants are named as such, and a View schema link opens the record's field list.

Licenses is a searchable multi-select with None, Current and All shortcuts. A report may span at most 20 licenses, and the counter turns red when you go over.

Rows come back grouped in the order the licenses were selected, and the caps are totals rather than per-license allowances. See Reporting Across Multiple Licenses.

Format

Four formats, each mapping to contentType:

Format Best for Includes Column picker Row layout Metadata preamble
CSV Spreadsheets and =IMPORTDATA One Yes Yes Yes
JSON Scripts and integrations Unlimited No No No
XLSX Opening in Excel directly One Yes Yes Yes
Google Sheets A sheet you intend to share or edit One Yes Yes Yes

Includes

Super reports only. Each include attaches related Metrc data (lab results, history, source harvests) to every record.

  • JSON accepts as many includes as the request budget allows, so the card is a set of checkboxes.
  • CSV, XLSX and Google Sheets accept exactly one, so the card becomes a radio group. This is a property of a flat grid, not a restriction T3 chose; see One include in tabular formats, many in JSON.

Selecting an include also adds the report's default metadata columns, which are the summarized form of the included data.

Includes cost one Metrc request per record, which is why super reports have a much lower row cap. See Limits.

Row layout

Super reports in a tabular format only. This card answers "what is one row of this report?", and it is the setting people most often get wrong.

Option One row is
Expanded (the default) One included record, one lab result, one history entry
Collapsed One top-level record, one package, results summarized

Ask for lab results on 500 packages expanded and you get one row per analyte per test; collapsed gives you 500 rows. Collapsed also keeps records whose include came back empty, which expanded silently omits.

The card appears whenever the endpoint offers includes and stays disabled until you select one, so it does not appear and vanish as you experiment. Switching to collapsed drops any column that came from the include, and the builder names the ones it removed.

Why the two shapes exist, and which columns survive a collapse: One row per record, or one row per included record.

Delivery

Two options, and the right choice is mostly about size:

Delivery What happens
Inline The report is generated while you wait. Subject to the 240-second request limit
Email A background worker generates the report and emails it to you. No time limit

For Google Sheets the same two options read as Open now (creates the sheet and opens it in a new tab) and Email link (a worker builds the sheet and emails you the link).

The Email field appears when it applies, and what it means depends on the delivery:

  • With email delivery it is required; it is where the report goes, and where any error is reported.
  • With Google Sheets opened inline it is optional. Filling it in shares the new sheet with that Google account; leaving it blank creates an unshared sheet.

Email delivery is the only way to retrieve a report that takes longer than 240 seconds. See Emailing a Report.

Report columns

Tabular formats only. Leave it on Default fields to get the report's standard columns, or switch to Custom fields to choose your own.

The custom picker has three parts, all bound to the same selection:

  • Available fields: a filterable checkbox list of every column on the record, plus any extra columns found in your data.
  • Selected: your chosen columns as a draggable list. The order here is the column order in the output.
  • Fieldnames: a comma-separated text box mirroring the other two. Type into it and the checkboxes follow; click a checkbox and the text updates. Paste a column list from a colleague here.

Bulk buttons reset the selection to the report's defaults, to everything, or to nothing.

Two things the picker will tell you about:

  • Past roughly 16 columns you get a soft warning. Nothing breaks, but wide reports get unwieldy fast.
  • Columns blocked by collapsed row layout are shown but not selectable, so you can see why a column you expected is unavailable.

Column names map directly to columns.

Column headers

Tabular formats only. By default each column gets a title-cased header derived from its name. Switch to Custom names to override any of them; a blank override keeps the default.

This renames the header row only, the columns and their data are unchanged. It is for matching an existing spreadsheet's headers so a downstream formula keeps working.

Headers cannot contain a comma

The override list is comma-delimited with no escape syntax, so a comma inside a header would split it into two. The builder rejects it rather than producing a misaligned file.

See Renaming the Column Headers.

Sort

Off by default. Turn it on to choose a field and a direction. The field list is limited to the columns the endpoint can actually sort on.

Sorting applies within each license, not across them. See Reporting Across Multiple Licenses.

Filter

Off by default. Each filter row is a field, an operator, and a value. Add as many as you need; once there are two or more, an AND / OR toggle decides how they combine.

Each row becomes one filter parameter, spelled field__operator:value:

https://api.trackandtrace.tools/v2/packages/active/report?licenseNumber=LIC-00001&filter=locationName__eq:Bulk Storage&filterLogic=and&contentType=csv

The full operator list is in Filtering and Sorting.

Filtering is the best fix for an oversized report

It brings the request back under its limits and gives you a more useful report besides. See Report Request Too Large.

Options

Option What it does
Row limit Caps how many records the report returns. Excellent for testing a wide report before running it for real
Prepend report metadata On by default. Adds a header block describing the report to CSV, XLSX and Google Sheets output. Turn it off when the output feeds a formula that expects column headers on row 1, see The Metadata Preamble
Open in browser instead of downloading Renders the report in the tab instead of saving a file. For troubleshooting only; a large report can hang the tab it renders into. See Downloading vs. Rendering

Next Steps