Get Rows

Get a Specific Row

You can retrieve a single specific row from a Data Store table of the given instance using the getRow() method. This is done by passing the unique ROWID of the row as the argument to this method, as shown in the code syntax below.

The <TABLE_INSTANCE> used in the code below is the instance defined in the Table Instance page.

    
copy
<TABLE_INSTANCE>.getRow( int id, void Function(ZCatalystRow) onSuccess, void Function(ZCatalystException) onFailed )

Parameters:

  • id: The unique ROWID of the particular row that needs to be retrieved

A sample code snippet is shown below:

    
copy
var table = dataStore.getTableInstance(identifier: 'Products'); table.getRow( id: 2823000000014176, onSuccess: (APIResponse response, ZCatalystRow row) { print('Get Row Success'); print('The row details are: ${row.getData()}'); //Actions executed on successfully fetching the row }, onFailed: (ZCatalystException exception) { print('Get Row failed: $exception'); //Actions executed upon a failed state }, );

Get All Rows

You can retrieve all the rows of a table of the given instance using the getRows() method, as shown in the code syntax below. If the operation is successful, this method will return all the rows of the table without any filters or conditions.

The <TABLE_INSTANCE> used in the code syntax below is the instance defined in the Table Instance page.

    
copy
<TABLE_INSTANCE>.getRows( void Function(List<ZCatalystRow>) onSuccess, void Function(ZCatalystException) onFailed )

A sample code snippet is shown below:

    
copy
var table = dataStore.getTableInstance(identifier: 'Products'); table.getRows( onSuccess: (APIResponse response, List<ZCatalystRow> rows, ResponseInfo resInfo) { print('Get Rows Success'); }, onFailed: (ZCatalystException exception) { print('Get Rows failed: $exception'); }, );

Last Updated 2023-09-03 01:06:41 +0530 +0530