How to Use Zapier to Update Firebase Firestore Records

Alexander Zorychta
2 min readSep 18, 2022

If you’re like me, you may have been disappointed to see that while you can create Firestore records with Zapier, you can’t edit them. Ah, the joy of no/low code tools.

Instead of you spending 2 or 3 hours trying to figure it out, here’s one way to solve it.

What You’ll Need

  • Firebase Firestore database
  • Zapier
  • Firebase Functions set up in a
  • Code Editor like Visual Studio

How It Works

1. Write this Cloud Function and deploy it into your Functions on Firebase.

exports.functionName = functions.https.onRequest(async (req, res) => {await admin //Firestore function to update a document
.firestore()
.collection(“users”)
.doc(req.query.docId)
.update({
fieldToBeUpdated: req.query.fieldName
});
res.status(200).send(‘success’);});

When you deploy it, grab the URL of the function. Should be something like https://xxxxxxx.cloudfunctions.net/functionName

2. In Zapier, set up a Webhook.

Set it as GET.

Enter the function URL. As query string params, add in any values you need to update the record, such as the documentId you are trying to change as well as the fieldName you want to change in the document.

DO NOT send as JSON.

Test and make sure it sends the response back.

You’re done!

--

--

Alexander Zorychta

Founder of Zalence. Seeking ways to increase the number of people leading meaningful lives through creative problem solving and high-quality connections