data-api
Rule: Domo App Platform Data Access (Toolkit-First)
This rule is toolkit/query-first. Use @domoinc/query for dataset reads in apps.
Canonical Query Approach
1) Use @domoinc/query for dataset queries
yarn add @domoinc/query
import Query from '@domoinc/query';
const salesByRegion = await new Query()
.select(['region', 'Sales_Amount'])
.groupBy('region', { Sales_Amount: 'sum' })
.orderBy('Sales_Amount', 'descending')
.fetch('sales');
2) Keep SQL as exception-only
If you use SQL (SqlClient), remember it does not automatically respect page filters in dashboards.
import { SqlClient } from '@domoinc/toolkit';
const sqlClient = new SqlClient();
const result = await sqlClient.get(
'sales',
'SELECT region, SUM(Sales_Amount) AS total FROM sales GROUP BY region'
);
const rows = result.body.rows;
Required Manifest Wiring
Every dataset still must be declared in manifest.json under datasetsMapping.
{
"datasetsMapping": [
{ "alias": "sales", "dataSetId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "fields": [] }
]
}
Critical gotcha:
fieldsmust exist (can be[]) to avoid manifest parsing errors.
Local Development
- Use
@domoinc/ryuu-proxyfor local API routing. - Authenticate with
domo login.
Checklist
-
datasetsMappingaliases configured and valid - Queries implemented with
Query(not raw/data/v1by default) - Aggregations use actual dataset field names
-
.aggregate()not used
More from stahura/domo-ai-vibe-rules
domo-js
Use ryuu.js (domo.js) APIs for env, events, navigation, and data calls.
58appdb
Toolkit-first AppDB document CRUD, query operators, and collection wiring.
57html-deck
Build a professional HTML slide deck from source content and convert it to a pixel-perfect PDF. Covers slide architecture, layout patterns, print-safe CSS, Puppeteer PDF conversion, and quality verification. Use when creating presentation decks, converting documents to slide format, or generating PDF decks from HTML.
57migrate-lovable
Convert SSR-heavy Lovable/v0 apps into client-only Domo apps.
57jsapi-filters
Apply runtime filters to embedded Domo dashboards/cards from the host page via the JS API (MessagePort). Covers dynamic filtering, drill events, filter change listeners, iframe resize, pfilter URL params, overrideFilters, and App Studio appData. Use for any client-side Domo embed interaction. Not for server-side programmatic filters (use programmatic-filters).
56ai-service-layer
Toolkit-first AIClient patterns for generation, text-to-sql, and response parsing.
56