Get Column Value from Row

You can retrieve a specific column’s value in a row in a Data Store table using the getColumnValue() method. For example, if you require the value of a single column called ‘Employee ID’ in a row, you can use this method to obtain that specific value.

You must pass the Field Name of the column as the argument to the getColumnValue()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 )

Parameters:

  • id: The 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( 'The name of the product is: ${row.getColumnValue('product_name')}'); //Actions to be executed upon successfully fetching the column value }, onFailed: (ZCatalystException exception) { print('Get Row failed: $exception'); //Actions to be executed upon a failed state }, );

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