Get data from a Fliplet Data Sources

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

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.

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

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 and here, respectively.