Get Table Metadata

You can obtain the metadata of the tables in the Catalyst Data Store.

Get Metadata of All Tables

You can fetch the details of all the tables in a Catalyst project using getAll() method. The datastore and table instances used in the code snippet below are the component instance and the table object respectively.

This returns a promise which will be resolved to an object in which the content key contains the array of the meta details of all the tables.

    
copy
//Get metadata of all the tables in the project var datastore = catalyst.table; var allTablePromise = datastore.getAll(); allTablePromise .then((response) => { console.log(response.content); }) .catch((err) => { console.log(err); });

A sample response that you will receive for each version is shown below:

    
WebSDK
copy
[
{
"project_id":{
"project_name":"AlienCity",
"id":"2136000000007733"
},
"table_name":"AlienCity",
"modified_by":{
"zuid":"66466723",
"is_confirmed":false,
"email_id":"emma@zylker.com",
"first_name":"Amelia",
"last_name":"Burrows",
"user_type":"Admin",
"user_id":"2136000000006003"
},
"modified_time":"Aug 13, 2021 01:47 PM",
"table_id":"2136000000007781"
},
"table_name":"CityDetails",
"modified_by":{
"zuid":"66466723",
"is_confirmed":false,
"email_id":"emma@zylker.com",
"first_name":"Amelia",
"last_name":"Burrows",
"user_type":"Admin",
"user_id":"2136000000006003"
},
"modified_time":"Aug 13, 2021 01:47 PM",
"table_id":"2136000000009090"
}
]
[
{
"project_id":{
"project_name":"AlienCity",
"id":2136000000007733
},
"table_name":"AlienCity",
"modified_by":{
"zuid":66466723,
"is_confirmed":false,
"email_id":"emma@zylker.com",
"first_name":"Amelia",
"last_name":"Burrows",
"user_type":"Admin",
"user_id":2136000000006003
},
"modified_time":"Aug 13, 2021 01:47 PM",
"table_id":2136000000007781
},
"table_name":"CityDetails",
"modified_by":{
"zuid":66466723,
"is_confirmed":false,
"email_id":"emma@zylker.com",
"first_name":"Amelia",
"last_name":"Burrows",
"user_type":"Admin",
"user_id":2136000000006003
},
"modified_time":"Aug 13, 2021 01:47 PM",
"table_id":2136000000009090
}
]

Last Updated 2023-11-14 13:20:49 +0530 +0530