Skip to main content

Data Query

Data Query Module Overview

The Data Query Module lets users write and run queries or supported commands on configured Data Sources. Data Queries perform CRUD operations on any supported data source.

note

Queries always run against a datasource in the same tenant (datasourceID FK). Execution from workflows, app pages, and listeners reuses the caller's identity plus an origin reference for delegated authorization — see Identity & Access Management.

Create a Data Query

  1. Click on the Queries Tab
  2. Click on Add query button in the right hand side drawer list

image-20260617-120738.png

  1. A query configuration form will appear
  2. Select your configured data source
  3. Dynamic fields will appear in the form which are supported by the data source
  4. Once all the details are filled, you can click on test to test your query

image-20260618-100048.png

Query Variable Usage

  • Queries support moustache format based variable usage.
  • Add all the variables which you want in the Args section.
    • Use the {{inputs.variable}} format to reference that variable anywhere in the query config (excluding title and description).

image-20260618-095852.png

Endpoints

Mounted at /api/v1/tenants/:tenantID/queries:

MethodPathPermissionNotes
GET/schemasdataquery.listper-datasource config JSON schemas for the query form
GET/dataquery.listlist (supports ?folderID=)
POST/dataquery.createcreate; grants creator access
GET/:dataQueryID/exportdataquery.readexport single query as bundle item
POST/:dataQueryID/clonedataquery.createdeep copy with fresh ID
PATCH/queryTestdataquery.executead-hoc test without saving
GET | PATCH | DELETE/:dataQueryIDdataquery.read/update/deleteCRUD on one query
POST/:dataQueryID/queryTestdataquery.executetest saved query
POST/:dataQueryID/rundataquery.executeexecute with Args variables

Execution notes

  • POST /run and /queryTest resolve {{inputs.*}} server-side before dispatching to the connector in @jet-admin/datasources-logic. Secrets are resolved from vault/datasourceOptions and redacted in responses via utils/sensitive.js.
  • Workflows call queries through the dataQuery node (nodeConfig.dataQueryID); app pages through TRIGGER_QUERY widget actions. Both pass the original caller identity + origin for delegated authorization.