Quickbase Tutorials

Code Pages Developer Lab

A hands-on Quickbase API curriculum built from working Code Page examples.

Lesson 4

Quickbase Query Operators

Lesson 3 taught us how to build one Quickbase query condition. Now we are going to examine the part in the middle that determines how Quickbase performs the comparison.

CompleteQDLREST whereQuery Operators

We Already Used a Query Operator

Lesson 3 searched Favorite Color with this Quickbase condition:

{8.EX.'Blue'}

At the time, we learned that 8 identified Favorite Color and 'Blue' was the comparison value.

But there was another Quickbase instruction sitting directly between them:

EX

The Query Operator

Where This Fits in the REST API

The Quickbase REST specification defines where as the Quickbase query-language filter that determines which records are returned. If it is omitted, the query returns all records.

const query = {
  from: TABLE_DBID,

  where: "{8.EX.'Blue'}",

  select: [3, 6, 7, 8]
};

Lesson 4 does not introduce a different REST endpoint. We are learning more of the query language already being sent through where.

Interactive Query Language Lab

Build a Quickbase Query Condition

Change the field, operator, and comparison value. React will assemble the same Quickbase query syntax used by the working Code Page.

Type: text

Exact Match

Text is represented as a quoted value.

Generated Quickbase Condition

{8.EX.'Blue'}

Field

8

Quickbase Field ID for Favorite Color.

Operator

EX

Exact Match

Compare the Quickbase field against the supplied value for an exact match.

Value

'Blue'

Comparison value supplied to Quickbase.

What does EX change?

It changes how Quickbase compares Favorite Color against 'Blue'.

Best suited here for: Text or numeric equality.

Guided Experiments

Load one of the lesson examples and watch the grammar change.

Teaching simulator only

This React component does not contact Quickbase. It demonstrates how the query condition is assembled. The working PeoplePage_operators.html Code Page performs the actual REST request inside Quickbase.

The Grammar of One Quickbase Condition

Stop looking at the condition as one mysterious string. It has three meaningful pieces:

{ 8 . EX . 'Blue' }
8
Quickbase Field ID
Favorite Color
EX
Query Operator
Determines the comparison
'Blue'
Comparison Value
Value supplied to Quickbase

Field → Operator → Value

That is the foundational structure this lesson is teaching.

Operator Reference for This Lab

The working Lesson 4 Code Page exposes seven operator choices: EX, XEX, CT, GT, GTE, LT, and LTE.

EX

Exact Match

{8.EX.'Blue'}

Favorite Color matches Blue.

EX condition structure is represented in the Quickbase REST specification.

XEX

Not Exact Match

{8.XEX.'Blue'}

Exclude exact Blue matches.

Included in the working Lesson 4 operator lab.

CT

Contains

{8.CT.'lu'}

Favorite Color contains the supplied text.

CT appears directly in the Quickbase REST query example.

GT

Greater Than

{7.GT.30}

Age is greater than 30.

GT condition structure appears directly in the Records API documentation.

GTE

Greater Than or Equal

{7.GTE.30}

Age is at least 30.

Included in the working Lesson 4 operator lab.

LT

Less Than

{7.LT.30}

Age is less than 30.

Included in the working Lesson 4 operator lab.

LTE

Less Than or Equal

{7.LTE.30}

Age is no greater than 30.

Included in the working Lesson 4 operator lab.

Documentation boundary

The REST specification we have in the project directly demonstrates EX, CT, and GT condition syntax. The remaining operators are present in the completed Lesson 4 Code Page, but the REST specification itself does not enumerate their definitions. For a formal operator reference, the dedicated Quickbase Query Language documentation remains the authoritative source.

Text and Numeric Comparison Values

Lesson 4 also exposes another useful part of query construction: the comparison value has a data type.

Text Field

Favorite Color

Blue
↓
'Blue'
↓
{8.EX.'Blue'}

Numeric Field

Age

30
↓
30
↓
{7.GT.30}

The finished Code Page handles this distinction by checking the selected field's type before assembling the comparison value.

The Important JavaScript Change

Lesson 3 hard-coded the search condition around Favorite Color and EX.

Lesson 4 makes the three components variable:

function runOperatorQuery() {
  const fieldSelect =
    document.getElementById("queryField");

  const operatorSelect =
    document.getElementById("queryOperator");

  const valueInput =
    document.getElementById("queryValue");

  const preview =
    document.getElementById("queryPreview");

  const fieldId =
    fieldSelect.value;

  const fieldType =
    fieldSelect.options[
      fieldSelect.selectedIndex
    ].dataset.type;

  const operator =
    operatorSelect.value;

  const value =
    valueInput.value.trim();

  let comparisonValue;

  if (fieldType === "number") {
    comparisonValue = value;
  } else {
    comparisonValue = `'${value}'`;
  }

  const where =
    `{${fieldId}.${operator}.${comparisonValue}}`;

  preview.textContent = where;

  loadPeople(where);
}

The crucial line is:

const where = `{${fieldId}.${operator}.${comparisonValue}}`;

Once that line makes sense, the query is no longer something to memorize. It is something you can construct.

Working Quickbase Experiment

PeoplePage_operators.html

The React lab above teaches the syntax. The actual Quickbase Code Page performs the real experiment: construct the condition, place it in REST where, send the query, and display only the matching records.

Why We Are Stopping at One Condition

Quickbase query language can grow beyond one condition, but Lesson 4 intentionally does not introduce AND, OR, or compound expressions.

ONE FIELD
↓
ONE OPERATOR
↓
ONE VALUE
↓
ONE CONDITION

The training notes deliberately kept compound conditions outside this lesson so the student first understands the grammar of a single condition.

Later, expressions containing several conditions will be much easier to read because each individual piece already has meaning.

Lesson 4 Complete

You should now be able to look at a condition such as:

{7.GTE.30}

and recognize three independent Quickbase instructions: which field is being tested, how Quickbase should compare it, and what value it should compare against.

Lesson 3 taught us to send a condition. Lesson 4 taught us to read and construct the language inside that condition.