Create Dashboards from a Firestore Database
💠Would you like to go over this topic with an instadeq specialist?
📅 Book a Call Free of Charge
Firestore
NoSQL database built for global apps
Cloud Firestore is a NoSQL document database that lets you easily store, sync, and query data for your mobile and web apps - at global scale.
You can use Instadeq to create live dashboards, reports and make interactive analysis of your Firestore data.
Step 1 - Open Firebase Homepage
Go to https://firebase.google.com/ and create an account if you don't have one yet, then login and go to the main console.

Step 2 - Create a new Project
Select an existing project or create a new one.

In this example I will call it Flickr Photos and use geolocated data for photos uploaded to Flickr.

You can disable Google Analytics if it is a test project


Step 3 - Create a Firestore Database
Click on Firestore Database

Click on Create Database

Start in test mode only for the next 30 days, you should change this security rules before you share your dashboard.

Select your desired location to create the Firestore Database

Step 4 - Create a Firebase Card on Instadeq

Step 5- Create a new app in Firebase
We need to create a new app in Firebase in order to access to our Realtime database from an external app.

You can name it Instadeq.

Step 6 - Copy Firebase Configuration to Instadeq Firebase Card
Firebase will generate configuration properties that you need to copy to Instadeq Firebase Card.
We won't enable authentication for this test but we recommend you to read and configure Firebase Authentication.
Fill the configuration fields in API Keys Section.
You can disable "Require Authentication" in the Security Section (please enable authentication before sharing this dashboard).

Step 7 - Allow Readmode for your Database
Allow read mode for your Firestore Database. This is for test purpouse only. Later you should configure more advanced security rules.

Step 8 - Create a collection and documents
Start a new collection. In this example, I call it photos.
Add a few documents to it. I added information about photos uploaded to Flickr with:
gender (number)
faves (number)
description (string)
title (string)
lat and lon (numbers)
owner (string)
season (number)
etc

Firestore Queries
Instadeq has an internal Firestore Query Parser for the Query field.
You can write multiple condition using the WHERE condition separated by 'and', ORDER BY fields and/or LIMIT the results.
FROM "collection1" WHERE a == 4 and b != "hello" and c < 4.5 ORDER BY a, b DESC, c ASC LIMIT 5
Go to General tab and select:
Database Type = Firestore
Query Type = Run Once
Query = Your desired query
When ready select Apply.

Query Types
We have different types of queries:
Run Once: The query runs only when the deck or dashboard are loaded
Subscribe to Changes: Every time that you add a new document that applies to the query, Instadeq Firebase Card will update the data
Run on Intervals: The query runs when the deck or dashboard is loaded and later on the interval of seconds configured.
Advanced Queries
To query Collection Groups, use COLGROUP:
FROM COLGROUP "collectionGroupName" WHERE a >= 4
To get an specifict Document:
FROM DOC "documentID"
Instadeq will parse your query and send it to Firestore as explained in Firestore Query Documentation.
obj. .collection("collection1") .where("a", "==", 4) .where("b", "!=", "hello") .where("c", "<", 4.5) .orderBy("a", "asc") .orderBy("b", "desc") .orderBy("c", "asc")
We have a Playground to test different queries.
Firestore Errors
In the tab Error you can find any error parsing the query, Firestore indexes missing, permission problems, etc.


Step 9 - Check data appears on Instadeq
Check the results of your query appears on the Output tab

Step 10 - Build your live Dashboard
Now you can follow our guides, videos or use our templates to create a live no-code dashboard using the data from Firestore.

💠Would you like to go over this topic with an instadeq specialist?
📅 Book a Call Free of Charge