Connecting Zapier to Firebase: Query issue with nested fields

Hey everyone, I’m stuck trying to connect my Zapier account to Firebase. I want to trigger an action when a new entry appears in a collection. But I’m running into problems with the query, especially for nested fields.

Here’s what I’m using:

"orderBy": [{
    "field": {
        "fieldPath": "startDateInMilliseconds"
    },
    "direction": "DESCENDING"
}]

This works fine for top-level fields, but not for my nested ones under a subcategory “d”. When I test it with nested fields, I get an error saying no documents were found.

Has anyone dealt with this before? How can I modify the query to work with nested fields? I’d really appreciate any help or tips you can offer. Thanks!

heya miat, had similar issues. try flattening ur data structure if possible. if not, use dot notation like ‘d.startDateInMilliseconds’ in the fieldPath. might need to adjust firebase rules too. good luck!

As someone who’s wrestled with Zapier and Firebase integration, I can relate to your frustration. One trick that worked for me was using a combination of dot notation and array indexing for deeply nested fields. For instance, if your ‘startDateInMilliseconds’ is nested under multiple levels, try something like:

"orderBy": [{
    "field": "d.events[0].startDateInMilliseconds",
    "direction": "DESCENDING"
}]

Also, ensure your Firebase rules allow for querying these nested fields. Sometimes, the issue lies in the security rules rather than the query itself. If all else fails, consider creating a Cloud Function to flatten your data structure before querying. It’s an extra step, but it can save you headaches in the long run when dealing with complex nested data in Zapier integrations.

I’ve encountered this issue before when working with Zapier and Firebase. The key is to use dot notation for nested fields, as Liam mentioned. However, you’ll also need to adjust your query structure slightly. Try this approach:

"orderBy": [{
    "field": "d.startDateInMilliseconds",
    "direction": "DESCENDING"
}]

This format should work for querying nested fields. If you’re still having trouble, double-check your Firebase security rules to ensure they allow access to nested fields. Also, verify that the field path exactly matches your Firebase document structure. Let me know if you need further clarification on implementation.