---
schema_version: "1"
id: a17cdb523ede8fedfaa834806634aa8af12f856b1954a9f15d9948499a134dc6
title: QueryResult
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_tooling/tooling_api_objects_queryresult.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_queryresult.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 45c930ded77120d10816bb28cd0b71fc2336341f9306fd7829d0186ee1846d1d
description: Represents the results of a query. For example, if you query on the object EntityDefinition, all the layouts for that entity are returned as an array of QueryResult objects in the Layouts field. Available in Tooling API version 34.0 and later.
---
# QueryResult

Represents the results of a query. For example, if you query on the object EntityDefinition, all the layouts for that entity are returned as an array of QueryResult objects in the Layouts field. Available in Tooling API version 34.0 and later.

QueryResult is not an extension of sObject.

## Fields

| Field | Details |
| --- | --- |
| done | 
Type

boolean

Description

If true, no additional rows can be retrieved from the query result. If false, one or more rows remain to be retrieved. Use this value as a loop condition while iterating through query results.



 |
| entityTypeName | 

Type

string

Description

The object or entity type, such as ApexClass or CompactLayoutInfo.



 |
| nextRecordsUrl | 

Type

string

Description

If the results exceed the current batch size, this field contains the URL of the next record in the query result set. This field is populated for the REST resource queryAll, and is analogous to queryLocator for SOAP calls.



 |
| queryLocator | 

Type

QueryLocator

Description

If the results exceed the current batch size, this field contains a unique identifier used to retrieve the next batch of records. This field is populated for SOAP queryMore() and is analogous to the REST resource queryAll.

Each new batch returns a new queryLocator value.



 |
| records | 

Type

sObject

Description

Array of sObjects matching the data specified in the query.



 |
| size | 

Type

int

Description

Total number of rows returned. If no rows were returned, the value is (0). This field is the same as the size field in QueryResult in the Enterprise and Partner WSDLs.



 |
| totalSize | 

Type

int

Description

Total number of rows returned. Indicates whether the query retrieved any rows (any value greater than 0) or not (0). This field is the same as the totalSize field in QueryResult using the REST resource query or queryAll.



 |

## QueryLocator Metadata

| Field | Details |
| --- | --- |
| queryLocator | 
Type

string

Description

If the results exceed the current batch size, this field contains an identifier. Use with the SOAP queryMore() call to retrieve the next batch of records. Each new batch returns a new queryLocator value.



 |