Skip to main content
Version: 1.x

Function: getEntityCount()

getEntityCount(page, path, options?): Promise<number>

Ai

Reads the number of entities in a binding from the UI5 model.

Parameters​

page​

ODataPage

Playwright Page (or compatible subset).

path​

string

OData model path (must start with '/').

options?​

ODataOptions

OData options (timeout, modelName).

Returns​

Promise<number>

The entity count (0 if no data or not an array).

Capability​

ui5.odata.getEntityCount

Intent​

Count the number of entities at a specific OData model path.

Guarantee​

Returns the array length at the path, or 0 if data is not an array or not loaded.

Ai Context​

Returns array length from getData() at the path. Returns 0 if not an array.

Sap Module​

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

Business Context​

Verify expected entity counts in list bindings.

Example​

const count = await getEntityCount(page, '/Products');