Question

Firebase / Firestore - Zap - Find Cloud Firestore Collection Document using userid

  • 21 January 2024
  • 3 replies
  • 18 views

Need help with below firebase / firestore related structured query in Zapier.

Attached image of Zapier steps with structured query on the right hand side!below automation steps / purpose  in Zapier and the firebase structured query is not working in Step 2.

 

Can you help? - Zapier support is not able to resolve.

  • Step 1: When a new collection document is added in Firebase. (Aim : Get UserId from a firestore document) - This is working 

  • Step 2: Find Cloud Firestore in the Users collection Document in Firebase / Firestore. (Aim : Get email address based on userId in step 1). - This is not working 

  • Step 3: Send email address to Convertkit tag (Aim : Tag the user in convertkit based on email address)

 

 


3 replies

Userlevel 7
Badge +11

Hey there, @FinTorro.com! 👋

It seems as though there was an issue with the upload of that image as I’m not seeing any images attached here. Would you mind re-uploading the image so we can take a closer look at that query from step 2? 

Also, are you seeing any error messages when the query is run? If you are, could share a screenshot of the full error message (or copy and paste the text from it here)? Remember to remove/hide any private information (like names, emails, addresses etc.) from any screenshots before sharing. 

Thanks for your assistance on this, looking forward to hearing form you! 🙂

 @SamB  Hi There, 

Thank you.

Just attaching here

 

 

Userlevel 7
Badge +11

I’m so sorry for the delay in a reply here, @FinTorro.com!

I did some testing in my own account and was able to get it working by updating the query to the following:
f923eea90558d264901b97f07f3707a9.png
Here’s the code I used:

"where": {
"fieldFilter": {
"field": {
"fieldPath": "documentId"
},
"op": "EQUAL",
"value": {
"stringValue": "Document ID goes here"
}
}
},
"limit": 1

However, it was only able to work if a field called documentId field contained the path as well as the document’s ID number. As that’s what’s included in the selected ID field from the trigger step: 
09ea9bd68651621f381609a5019ac7f1.png

If the documentId field in your database only includes the ID number then you’ll want to try using a Formatter (Text > Split Text) action to separate the ID number from the Path. Then in your Find Cloud Firestore Document action you’d use the ID that’s been extracted by the Formatter action, instead of selecting it from the trigger step.

Hope that helps. If you run into any further trouble on that please let me know, happy to help further! 

Reply