BuildShip Logo
BuildShipĀ Templates

Firestore CRUD Operations

Simple template to showcase how you can create workflows for Read, Write/Update, and Delete operations on your Firebase Firestore database collection

409

Report this template

Select the reason for reporting

Describe the issue in detail

Share template

Link to template

https://templates.buildship.com/template/SpxD5CbijbGG/

This template contains 3 flows:

Inputs

collection name

fakeusers
This is a static example using sample inputs. Remix the template to run it with your own values.

Output

Read me

šŸ“– How to do CRUD operations in your Firestore collections

Overview

This template allows you to perform the following actions on a Firestore collection:

  • Read Data
  • Create Data
  • Update Data
  • Delete Data

Prerequisites

Connecting to Your Own Firebase Project

Users can connect their Firebase projects byĀ providing the Project IDĀ andĀ setting up permissions for the BuildShip Runtime Service Account

Steps to set up your own Firebase Connection:

Access BuildShip Settings

Navigate to theĀ SettingsĀ section, found in the top-left corner of your dashboard, next to the Project Name.

Under theĀ GeneralĀ tab in BuildShip Settings, you will find information about theĀ underlying Firebase Project IDĀ andĀ Service Account details. Copy the Service Account details as we need this to grant access to your Firebase project.

Grant Access in Firebase IAM & Admin

  • Navigate to theĀ IAM & AdminĀ section from the Firebase project's GCP Console.
  • Click on theĀ Grant AccessĀ button to add a new principal.
  • Paste the Service Account detailsĀ you copied from BuildShip into the "New Principal" field.
  • Assign the role ofĀ Cloud Datastore UserĀ andĀ Firebase Admin SDK Administrator Service AgentĀ to the Service Account.
  • Hit theĀ SaveĀ button to grant access to the Service Account.

This will allow BuildShip to interact with your Firebase resources.

šŸ’”Please note that GCP takes time (approx 2 to ~7 minutes or more in extreme cases) for access changes through the system. For more info refer to this documentationĀ here(opens in a new tab).

Troubleshooting

Follow these troubleshooting steps in case you receive the following errors:

āœļø How to Use

Step 1: Add your Project ID as an environment variable.

You can find your Project ID in the URL after 'project/' https://console.firebase.google.com/u/0/project/buildship-008vd0

Step 2: Change the default value of the 'collection name' input

Step 3: Test your workflow

-

šŸ”— Resources

Any additional information like demo links or YouTube tutorials.