Datamart Query Data

The datamart_query_data tool retrieves filtered and sorted row-level data from a single Datamart, up to the specified row limit. The tool does not aggregate data or join multiple Datamarts.

  • Tool Name – datamart_query_data

  • Title – Datamart Query Data

  • Type – Private

Parameters

Parameter

Required

Description

datamart

Yes

The technical name of the Datamart to query, for example, Standard_Sales_Data. The name is case-sensitive and uses underscores.

columns

Yes

The exact column names to return. Every column referenced in filters or sort_by must also be included. * is not supported.

filters

No

List of filter conditions, combined with AND. Each entry is an object: {column, operator, value}column must be one of columns. Default: no filter.

filters[].operator

-

Supported operators are:

  • equals

  • notEqual

  • greaterThan

  • greaterOrEqual

  • lessThan

  • lessOrEqual

  • inSet

  • notInSet

To specify a range, use two filters on the same column: greaterOrEqual and lessOrEqual.

filters[].value

-

The comparison value. Use a non-empty list with inSet or notInSet; otherwise, use a single string, number, or boolean value.

sort_by

No

A single column name to sort by, one of columns. Prefix with - for descending, e.g. -NetRevenue.
Default: No specific order.

max_rows

No

Maximum rows to return, 1 – 500.
Default: 50.
Requests below 1 or above 500 are automatically adjusted to the nearest allowed value.

The tool queries Datamarts only. It does not query Data Sources.

The tool returns row-level data from a single Datamart. It does not support aggregation or joins. Date filters may fail when the filter value type does not match the Datamart column type. When available, use derived date fields such as *Year or *Month for date-based filtering.

Output

Returns an object with the following fields.

Field

Description

datamart

The Datamart that was queried.

columns

Columns present in each row, in order.

rows

Matching rows, keyed by column.

row_count

Number of rows returned.

max_rows

The row limit actually applied after adjustment.

applied_filters

The filter conditions actually applied, echoed back.

truncated

true when row_count equals max_rows. Additional matching rows may exist beyond the row limit.

Example

Request

JSON
datamart="Standard_Sales_Data", columns=["Customer", "Product", "PricingDate", "InvoicePrice", "Quantity"], sort_by="-PricingDate", max_rows=10

Response

Here are the last 10 transactions (most recent by Pricing Date, 2025-12-31) in Standard_Sales_Data:

Customer

Product

Pricing Date

Invoice Price

Quantity

Lakers Industrial Distributor (CID-0098)

BN1350M2

2025-12-31

$2,468.81

5

Lakers Industrial Distributor (CID-0098)

MEG5220-6033

2025-12-31

$52.98

5

Lakers Industrial Distributor (CID-0098)

MEG5220-6036

2025-12-31

$79.04

5

Milo H (CID-0070)

CN9789

2025-12-31

$548.60

2

Milo H (CID-0070)

A9N2103

2025-12-31

$485.95

2

SO Company Inc UK Global customer Paddington (CID-0031)

R9H13603

2025-12-31

$197.68

2

SO Company Inc UK Global customer Paddington (CID-0031)

TR47513

2025-12-31

$547.81

2

Gabe Corporation (CID-0037)

IMT80020

2025-12-31

$6.14

2

Gabe Corporation (CID-0037)

MEG5220-6033

2025-12-31

$7.72

1

Gabe Corporation (CID-0037)

R9H13601

2025-12-31

$46.17

2

truncated: true (10 rows returned == max_rows; more transactions on 2025-12-31 or earlier may exist)

See Also