Get Column Value from Row

You can retrieve a specific column’s value in a row in a Data Store table using the getFieldValue() 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 getFieldValue()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) → ZCatalystRow.getFieldValue(fieldAPIName: String): Any, failure: ((ZCatalystException) → Unit)? ): ZCatalystRequest<ZCatalystResponse<ZCatalystRow>>?

Parameters:

  • id: The The unique ROWID of the particular row that needs to be retrieved
  • fieldAPIName: The name of the column whose value needs to be fetched

A sample code snippet is shown below:

    
copy
ZCatalystApp.getInstance().getDataStoreInstance().getTableInstance("EmployeeDetails").getRow(2823000000054062, // Replace this with your table name and the ROWID of the row { row -> println(" The value of 'Employee ID' field is :${row.getFieldValue("EmployeeID")}") //Replace this with your column name }, { exception -> println("Failed to get the column value! $exception") })

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