---
schema_version: "1"
id: 4493291bbc6c8298059fa81dfb6a71a733876cf21a33265038484ec0a4431323
title: Configuring Query Operations
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/netsuite-rest-connector/latest/configuring-query-operations.md
canonical_url: https://docs.mulesoft.com/netsuite-rest-connector/latest/configuring-query-operations
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 837f8cdb26251e3668d0d72e74288ede54c35c91e2227b2d6bfccc16e15e1f6f
description: MuleSoft Documentation Site
release: "1.0"
latest: true
---
---
product: NetSuite REST Connector
version: 1.0
is-latest-version: true
---

# Configuring Query Operations

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Configure the operations that read collections of NetSuite data with automatic pagination: **SuiteQL
Query** and **Get All Records**.

Both operations paginate automatically and return an array of messages, so you can use a For Each
scope to process individual rows or records. Pagination attributes are available on each item’s
message attributes. For full parameter, output, and error details, see
[NetSuite REST Connector Reference](https://docs.mulesoft.com/netsuite-rest-connector/latest/netsuite-rest-connector-reference).

## Configure the SuiteQL Query Operation

The **SuiteQL Query** operation runs a SuiteQL query against NetSuite data with automatic pagination
by sending `POST /query/v1/suiteql`. SuiteQL is a SQL-like query language for NetSuite records.

To configure the **SuiteQL Query** operation:

1.  Select the operation on the Anypoint Code Builder or Studio canvas.

2.  In the **General** properties tab for the operation, enter these values:

    - **Query**

      The SuiteQL query string (for example,
      `SELECT id, companyname FROM customer WHERE companyname LIKE 'A%'`).

    - **Page Size**

      Number of rows per page, which maps to the REST API `limit` parameter. Defaults to 100.

    - **Max Total Results**

      Maximum total rows to return across all pages. Defaults to 100000, which matches NetSuite’s
      hard cap per query. Set to `-1` for unlimited, but NetSuite returns an error if the result set
      exceeds 100,000 rows.

### XML Configuration

This is the XML for this operation:

```xml
<ms-netsuite-rest:suiteql-query
    config-ref="Config"
    doc:name="SuiteQL Query"
    query="SELECT id, companyname FROM customer WHERE companyname LIKE 'A%'"
    pageSize="100"/>
```

### Output Configuration

The operation outputs an array of messages, each with a Binary payload (one SuiteQL row as JSON) and
`NetSuiteRestAttributes`. Pagination attributes such as `hasMore` and `offset` are available on each
item.

## Configure the Get All Records Operation

The **Get All Records** operation retrieves a collection of records with automatic pagination and
optional filtering by sending `GET /record/v1/{recordType}`. It returns ID stubs, so use **Get
Record** to fetch full record bodies.

To configure the **Get All Records** operation:

1.  Select the operation on the Anypoint Code Builder or Studio canvas.

2.  In the **General** properties tab for the operation, enter these values:

    - **Record Type**

      The NetSuite record type (for example, `customer`, `salesOrder`, or `invoice`).

    - **Filter Query**

      Optional NetSuite filter expression (for example, `email IS john@example.com`). For complex
      queries, use **SuiteQL Query** instead.

    - **Page Size**

      Number of records per page, which maps to the REST API `limit` parameter. Defaults to 100.

    - **Max Total Results**

      Maximum total records to return across all pages. Defaults to `-1` (unlimited).

### XML Configuration

This is the XML for this operation:

```xml
<ms-netsuite-rest:get-all-records
    config-ref="Config"
    doc:name="Get All Records"
    recordType="customer"
    filterQuery="email IS john@example.com"
    pageSize="100"/>
```

### Output Configuration

The operation outputs an array of messages, each with a Binary payload (one record ID stub) and
`NetSuiteRestAttributes`. Pagination attributes such as `hasMore`, `offset`, and `links` are
available on each item.

## See Also

- [NetSuite REST Connector Overview](https://docs.mulesoft.com/netsuite-rest-connector/latest/)

- [Configuring Record Operations](https://docs.mulesoft.com/netsuite-rest-connector/latest/configuring-record-operations)

- [NetSuite REST Connector Reference](https://docs.mulesoft.com/netsuite-rest-connector/latest/netsuite-rest-connector-reference)

- [Salesforce Help](https://help.salesforce.com)
