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( id: Long, success: (ZCatalystRow) → Unit, failure: ((ZCatalystException) → Unit)? ): ZCatalystRequest<ZCatalystResponse<ZCatalystRow>>?

Parameters:

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

A sample code snippet is shown below:

    
copy
val table = ZCatalystApp.getInstance().getDataStoreInstance().getTableInstance("EmployeeDetails") //Replace this with your table name table.getRow(2823000000014176, //Replace this with your Row ID { row -> println("Get Row Success") println(" The row details are: ${row.getData()}") }, { exception -> println("Get row failed! $exception") })

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( success: (List<ZCatalystRow>) → Unit, failure: ((ZCatalystException) → Unit)? ): ZCatalystRequest<ZCatalystResponse<ArrayList<ZCatalystRow>>>?

A sample code snippet is shown below:

    
copy
val table = ZCatalystApp.getInstance().getDataStoreInstance().getTableInstance("EmployeeDetails") //Replace this with your table name table.getRows( { rows -> println("Get Rows success") for (row in rows){ println("${row.id}") } }, { exception -> println("Get rows failed! $exception") } )