Skip to main content
Version: 1.x

Function: queryEntities()

queryEntities<TData>(page, serviceUrl, entitySet, options?): Promise<ODataHttpResult<readonly TData[]>>

Ai

Queries an entity set via HTTP GET with OData system query options.

Type Parameters

TData

TData = unknown

Parameters

page

ODataHttpPage

Playwright Page with request API.

serviceUrl

string

OData service root URL.

entitySet

string

Name of the entity set to query.

options?

ODataQueryOptions

Query options including $filter, $select, $expand, $orderby, $top, $skip.

Returns

Promise<ODataHttpResult<readonly TData[]>>

Array of entities with HTTP status.

Capability

ui5.odata.queryEntities

Intent

Read a collection of OData entities with optional filtering, sorting, and paging.

Guarantee

On success, returns an array of entities matching the query with HTTP status.

Ai Context

Uses Playwright's request API to GET the entity set with OData query parameters. Supports $filter, $select, $expand, $orderby, $top, $skip. Parses both V2 (d.results) and V4 (value) formats.

Sap Module

sap.ui.model.odata.v2.ODataModel, sap.ui.model.odata.v4.ODataModel

Business Context

Query business entities for test data verification or setup (e.g., find products by price, list open POs).

Example

const result = await queryEntities(page, '/sap/opu/odata/sap/SVC/', 'Products', {
filter: "Price gt 10",
select: "Name,Price",
top: 20,
});