Skip to main content

I'm using Zapier to look up user information in FireStore based on the user's email address. I have a Top Collection called "groups" which contain users. If I use the below query in Zapier and hard code the {GROUP_ID}, so that the path is "groups/{GROUP_ID}/users", then the query works. 
 

However, I won't know the GROUP_ID at the time of the query. I'm thinking I'll need to loop through all groups (since google's collection groups don't appear to be supported in Zapier). But in order to loop through the groups, I first need to get a list of all the GROUP_ID's.

Because the GROUP_ID's are the top level sub-collection, I can't seem to figure out how to get Zapier to return a list of all of them. Zapier requires that I specify a collection group (groups) and a field path, and cannot leave either blank.

Any help is much appreciated! Thanks!

Hi @Ginny I’m not 100% familiar with firestore, but I get the basic concept of what you are trying to do. 

 

So let me just clarify, you cannot put just “groups” or “groups/” in the Collection field, correct?

 

Assuming that is the case, how often does the list of groups (aka group IDs) change? 

 

Does this firestore trigger run when a new group is created?

If so, OR if the groups don’t change that often you sould store the group IDs in a Google Sheet, and then use this tip to run through the rest of your zap for each group ID in that spreadsheet. 

 

These are jsut some ideas, hopefuly with some more clarification we can come up with a decent/workable workaround.

 

 


Hi @Paul

Thanks for your reply! We’ll get a new ID every time we onboard a new customer, so relatively frequently.

If I only put “groups” in the collection field, the query says that it cannot find results.

The googlesheet workaround could work, but it’s not ideal to duplicate all of our data over to googlesheets. I’d prefer to access it in Firestore.

Thanks for the suggestions though!


the alternative is looking into a direct API call to firestore. I think this is the right endpoint: https://firebase.google.com/docs/firestore/reference/rest/v1beta1/projects.databases.indexes/get

 

But you would need to develop an app on the Zapier platform or the CLI, both of which handle the Oauth2.0 required so it can access firebase/firestorm. This would then give you the ability to get the group IDs directly from firestore.