Get a Table Instance

A table reference can be created by referring to the predefined data store reference by passing either the tableID or table name as the parameter. The datastore_service reference used in the below code snippet is the component instance created earlier.

Get the Table Instance using TableID

The table_service reference can be created by passing the tableID as a parameter to the table() method. The datastore_service reference used below is already defined in the component instance page.

    
copy
#Get table instance using table ID table_service = datastore_service.table(5249000000011745)

Get the Table Instance using Table Name

Alternatively, a table reference can be created by referring the tablename in the table() method. There is no explicit response involved in these methods and only the instance of the table is returned.

The datastore_service reference used below is already defined in the component instance page.

    
copy
#Get table instance using table name table_service = datastore_service.table("CITY")

Last Updated 2023-12-18 16:20:08 +0530 +0530