BuildShip Logo
BuildShip Community

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

388

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.