# Access Data Table Records from JS

> Here is a list of a few options can use a few options to access an array of records for programmatic use.

Source: https://tadabase.com/docs/snippets/access-data-table-records-from-js  
Status: Not yet re-checked. Moved from our previous help site and not yet re-checked against the current product. Last edited Sep 20, 2024.

![Screenshot for “Access Data Table Records from JS”](https://community.tadabase.io/uploads/default/optimized/2X/8/872416adbbb6ffe3010c352af86b822e279590d1_2_690x468.png)

Here is a list of a few options can use a few options to access an array of records for programmatic use.

**Option 1 - The Tadabase JavaScript API (This is the option in the image above)** The [JavaScript API 3](https://tadabase.com/changelog/javascript-api) can be used to get an array of records that are currently being displayed on a component. For example, if I have a table component on a page with the component ID of **component_3**, I can add the following code to the JavaScript section of the page.

```
TB.render('component_3',function(data){
    console.log(data.records);
});
```

![Screenshot for “Access Data Table Records from JS”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665537174399.png)

**Option 2 - Custom Component**

Depending on your use case, you may be interested in Custom Component.

More info can be found here -> [Custom Component | Tadabase](https://tadabase.com/docs/pages/custom-component)

Custom component helpers can be found here -> [Custom Component Helpers | Tadabase](https://tadabase.com/docs/pages/custom-component-helpers)

**Option 3 - Our REST API**

More info can be found here -> [https://docs.tadabase.io/categories/manual/article/rest-api.](https://tadabase.com/docs)

> **Warning:** Please never save any API credentials in the Javascript of the page or app. This is 100% not secure, and your credentials will be exposed.

> **Note:** You can likely achieve similar results by using hosted scripts and, for example, a Google script as a web app or, more complex, a lambda function.

**Original Community Post:**

[Access data table records from JS - Community Discussions / How Do I - Tadabase Community](https://community.tadabase.io/t/access-data-table-records-from-js/1290)
