How can firestore nested collections be configured as a data resource? I tried nest property types List of Object to access the Document fields in the sub collection but could not get it to work
Hi @Tommy_Bystrom, the UI doesnât yet support integrating to subcollections, thatâs why my example was using an array structure instead. At this point, you could integrate to a subcollection by creating a REST API direct integration from the Data configurator, using the document ID as a URL placeholder.
Hi,
Okey, thank you. I know it is possible using REST API but was hoping for a more direct way of solving it. The data can not be rearranged because it is an existing webapplication that has been in use by our customer already 3 years. Am only looking for an easy way to make an android-app for his end-customers, it would add value to the whole solution and his business.
Hi Tommy_Bystrom,
as your question points exactly to what I would like to achieve as well: can you please post e.g. a screenshot how you are solving this now with REST API ?
thank you for the descriptions so far @Tommy_Bystrom ; @Mari
According to my understanding the steps should be like this:
-
creation of the API as described here : Use the Cloud Firestore REST API Â |Â Firebase
-
using data configurator as described in the AppGyver tutorial : Primer: Integrations and REST APIs - Composer
-
using my API accoring to the tutorial; including
-
my project-ID = black
-
collection = orange
-
document-ID = blue
-
sub-collection = green
-
but when testing, there is an error (despite the fact, that the data is received)
Do you understand this error?
You need to set Response Key Path = documents in the GET COLLECTION (GET) Config tab
Thank you all for the input to this topic. I not yet decided if I will try to make the app using REST API or not I was hoping they would have implemented support for subcollections and also since there does not seam to be support for the firebase realtime updates it seams this is not ready yet for Apps with firebase as a backend.
Hi John,
you helped me already a lot on how to configure the GET COLLECTION for a sub-collection on Firestore and it works just fine
Now I am stumbling about difficulties with the PUT and POST:
Letâs have a look on POST; this is what I received when trying my best:
This is how I have set up the object for the test:
and a look on the configuration:
also tried the configuration with âdocumentsâ (as it solved the issue with for GET)

Can you help please? I am lost in what firestore requires to comunicate with AppGyver hereâŠ
To create a record use HTTP request flow function. Set HTTP method to either post or PATCH (that one to create document setting your own ID). At body variable type in json format accordingly.
Alan, thank you for the hint; still the âHTTP Request flow functionâ seems to be more complicated and manual work.
I would realy like to get it working with the AppGyver-Data-Configurator.
Luckily I was able to get most of it going by following the docs (yes, it is worthwile to search these again and again ): Google Firestore REST API integration - Composer
(special thanks tho the author @Eduardo_Jaramillo )
Now I can use GET, POST and DELETE
BUT:
it does not describe how to get PUT running
For PUT it does not work yet:
For DELETE (and also GET and POST) it works fine:
- What is missing?
- Does anybody understand the error-message âError: TypeError: Failed to fetch. Does the server allow CORS?status: undefinedâ ?
- How to set up PUT for a firestore sub-collection correctly?
Hi Stayfoolish,
There is no PUT method in Firestore (see Cloud Firestore API Â |Â Google Cloud)
Eduardo
That is strange because Firebase Realtime Database accepts PUT.
Thank you for clarifiying, @Eduardo_Jaramillo and @JOHN_WORSHAM ,
now, with the understanding that
- the PUT method does not exist for Firestore and
- therefor of course also the data-configurator can not make use of the PUT method in this case
â I followed @Alan_Alves advice to use the âHTTP requestâ flow function. It works fine and isnât as complicated as I feared before. Thanks a lot, Alan!
Here is a screenshot for PATCH to firestore:
Should be mentioned to the screenshot above:
- the header can stay empty (=default), if no security rules restrict the access to this section in firebase.
- of course it is advisable to set up security rules (at least to: ⊠allow read, write: if request.auth != null; ) and authorize the PATCH request in the header with:
Authorization â Bearer idToken
Hi @stayfoolish
Iâm trying to follow your PATCH method to update the field.
Below screen shot is formula for URL to use HTTP Request, whereas Red underlined is Collection ID (âUser Dataâ) & Yellow Underlined is document (âTotal Unique IDâ)
Request body is data variable
Iâm not sure this will work fine, because I didnât set up the field which need to be updated & didnât do set up the new value which need to be updated in the existing field.
Tried and getting an error code 400, âmessageâ. Invalid JSON payload received
Please help me⊠Thanks in advanceâŠ
The best approach for debugging is to
- start by reducing as much complexity as possible.
- And then add elements one by one.
For your situation I would recommend to use PATCH with an empty body. If that works without an error, you have confirmed that the bug sits in the body.
To find a bug inside the body, manually change the body first to a single object. If that works, add the next object.
And some point you will confront the very element, that produces the error.