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 ‘product_name’ in a row, you can use this method to obtain that specific value.

You must pass the Column Name of the column as the argument to the getColumnValue()method, as shown in the sample code syntax. You must first fetch an instance of the row as shown below.

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

    
copy
Future<(APIResponse, ZCatalystRow)> <TABLE_INSTANCE>.getRow(int id)

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'); try{ var (response, table) = await table.getRow(id: 2823000000014176) } on ZCatalystException catch (ex) { print("GET ROW FAILED: $ex"); }

Last Updated 2024-09-12 18:16:13 +0530 +0530