# Get data from a Fliplet Data Sources

**URL:** <https://community.fliplet.com/t/get-data-from-a-fliplet-data-sources/388>\
**Category:** Code Library\
**Created:** [July 7, 2022, 10:47am UTC](https://community.fliplet.com/t/get-data-from-a-fliplet-data-sources/388 "2022-07-07T10:47:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mel](https://dub1.discourse-cdn.com/flex017/user_avatar/community.fliplet.com/mel/32/3_2.png) [@Mel](https://community.fliplet.com/u/Mel)\
**Post date:** [July 7, 2022, 10:47am UTC](https://community.fliplet.com/t/get-data-from-a-fliplet-data-sources/388/1 "2022-07-07T10:47:43Z")

</div>

### Getting data for your app from Fliplet’s cloud based Data Sources

**PRE-REQUISITES**

Please see the following before reading the below: [Data Sources JS APIs | Fliplet Developers Documentation](https://developers.fliplet.com/API/fliplet-datasources.html#data-sources-js-apis)

For the following code examples to work, you will need to add Fliplet’s Data Sources API to your app. To add it follow the steps [referenced here](https://community.fliplet.com/t/add-fliplet-s-data-sources-api-to-your-app/374).

In the code below, we are connecting to a data source with an ID of ‘18798’. You can find the data source ID in Fliplet Studio edit screen by selecting ‘App data’ from the right hand menu.

If a connection is successfully established the code then finds the data source and retrieves the data in the `records` variable.

JavaScript

```javascript
Fliplet.DataSources.connect(18798)
  .then(function (connection) {
    return connection.find();
  })
  .then(function (records) {
    // Here you can use the retrieved data
  });

```

The `records` variable is an array of objects that contains the following structure:

- `id`
- `data`
- `order`
- `createdAt`
- `updatedAt`
- `deletedAt`
- `dataSourceId`

You can find information on how to sort and filter the data from a data source, [here](https://community.fliplet.com/t/sorting-data/327) and [here](https://community.fliplet.com/t/filter-data/375), respectively.
