Create a New Table Instance
You can create a table instance for a particular table in the Data Store, and enable the methods defined in this class to access the instance object. This can be done by calling the getTableInstance() method in any of the two ways mentioned below.
The <DATA_STORE_INSTANCE> used in both the methods is the instance created earlier in the Data Store Instance page.
Create a Table Instance by its ID
You can create a table instance by passing the particular table ID as the argument to the getTableInstance() method, as shown in the code syntax below:
copy<DATA_STORE_INSTANCE>( id : Int64 ) -> ZCatalystTable
Parameters:
- id: The unique table ID of the specific table the instance needs to be created for
A sample code snippet is shown below:
copylet tableInstance = ZCatalystApp.shared.getDataStoreInstance( id : 109600000000207) //Replace this with your table ID
Create a Table Instance by its Name
Alternatively, you can create a table instance by passing the particular table’s name as the argument to the getTableInstance() method, as shown in the code syntax below:
copy<DATA_STORE_INSTANCE>( name : String ) -> ZCatalystTable
Parameters:
- name: The name of the specific table the instance needs to be created for
A sample code snippet is shown below:
copylet tableInstance = ZCatalystApp.shared.getDataStoreInstance( name : "EmployeeDetails") //Replace this with your table name
Last Updated 2023-09-05 20:06:31 +0530 +0530
Yes
No
Send your feedback to us