REST Console And Import/Export Added To Views

by on May 25, 2021

Views REST Console Feature

Views for Backendless Database now include a built-in REST Console for composing REST API queries that fetch data from your Views. You can also now import and export your Views.

Views are a powerful way to explore your data visually by composing datasets of related records in less time than writing queries. Views are available alongside data tables in Backendless Database.

REST Console For Views

While Views are designed to make it easy to create queries, we quickly realized that you won’t necessarily want to create a new View for every query. Rather, you may want to fetch data in a variety of ways from the same View.

With the Views REST Console, you can do just that. Once your View is set the way you want it, you can use the REST Console found in the View console to craft API queries based on that View.

Views REST Console

In the REST Console, you can use SQL syntax to add where clauses to create new queries. As with the REST Console attached to all data tables, the Views REST Console generates a Request URL that can be used to access the query via API.

Note that queries use the column names assigned to the View. This is opposed to using the column name found in the data table where the data is stored.

For example, let’s look at a fictional film database (the same used in our Views instructional series). In the database, we have a table called category with a column called name. For clarity, in the View, we have renamed this data to filmCategory.

Thus, when we create a query in the Views REST Console, we will use the column name filmCategory:

Views REST Console Example with SQL

You can also export the query directly from the REST Console:

Export View Query from REST Console

Import/Export Views

In addition to the Views REST Console, we have also added the capability to import and export your Views.

When importing an application into Backendless, any Views you have created may be imported as well. This is particularly beneficial for app-to-app deployment, where you have separate development (or staging) and production apps.

Similarly, you may export Views from the Manage -> Export section of your Backendless backend:

Export Views

If you have any questions or comments on these new updates, head over to our Support Forum or Slack channel and we’ll be happy to help.

Thanks for reading and Happy Codeless App Building!

Leave a Reply