NetSuite SuiteTalk icon

NetSuite SuiteTalk

NetSuite REST API

Execute SuiteQL

AI-generated

Summary

Executes a SuiteQL query against NetSuite's REST API with automatic client-side pagination. It retrieves data in pages up to 1000 items each, honoring the 'Return All' toggle to either fetch all matching results or limit to a specified maximum. Pagination state is tracked in the node context for efficient continuation via hasMore, count, offset, and totalResults.

Inputs

  • query (required) — The SuiteQL query string to execute.
  • returnAll — Whether to return all results by paginating through all pages (true) or return only up to the specified limit (false).
  • limit — The maximum number of result records to return when 'Return All' is false. Default is 1000 in runtime, with UI default set to 50.
  • offset — Number of records to skip before starting to return results; managed internally and exposed for pagination.
  • version — API version used by the NetSuite REST client (default 'v1').
  • options — Additional options for the request, including retries and full response control.

Output shape

An array where each element represents a SuiteQL query result row wrapped in a 'json' property. The node context is set with pagination info: hasMore, count, offset, and totalResults to assist with subsequent paginated queries.

Each returned item corresponds to a SuiteQL result row. Pagination is handled internally across multiple API queries when 'Return All' is true, or limited by the 'Limit' parameter otherwise.

Examples

Example 1: Run a SuiteQL query and return up to 50 results (the UI default limit).

Set the query string and keep Return All set to false with Limit set to 50.

Example 2: Retrieve all records matching the SuiteQL query across multiple pages with automatic pagination.

Set Return All to true; the node pages through results in batches of up to 1000 until all data is retrieved.

Links

Discussion