Get record details from firebase

hi guys

I am playing around with the firebase integration. So far I managed to store date into firestore and display them with the list item.

But I am struggling to access a single record on my details page. I am unsure what parameter I can bind the open page with as firebase creates own ids which I cannot access.

Thanks for the help
Andreas

1 Like

Hi, Andreas,

we are currently having the same “issue”. With Firestore you can access collection which returns the document ID, however, if you try to use “Get single record” there’s no way to get Document ID first. Maybe a direct API call will solve this, will try today and let you know.

Hi Jaroslav, thanks for your post, I am curious what you will figure out!

till later
Andreas

Andreas, so I have find the solution, but not sure, you’ll be happy with that as it suits our use case. Basically I will call the endpoint, that creates a custom Document ID. This DocumentID will be 1:1 to UserUID and therefore we will be able to link User directly to the document.

If needed sending API schema:

POST https://firestore.googleapis.com/v1/projects/{nameOfYourProject}/databases/(default)/documents/{nameOfYourCollection}?documentId={customDocumentId}

JSON
{
“fields”: {
“bio”: {
“stringValue”: “Here comes the boom!”
},
“full_name”: {
“stringValue”: “Jane Doe”
},
“profile_pic”: {
“stringValue”: “”
}
}
}

Hope it helps your cause! :slight_smile:

Hi Jaroslav

Not really, to be honest. I am a total beginner and thought of creating my first app with AppGyver. But no code seems not to mean no programming skills…

What I have thought of: Isn’t it possible to generate UUID and add the generated UUID to the firestore DB and have then access to it?

Thanks
Andreas

@Andreas_Niedermann What you are describing is probably something I sent you API above for, if I understand it right. Don’t worry, REST looks scary but it’s a really simple to use. Basically add a HTTP Request node. URL is the POST url I send you above. Method is POST then there are headers. You can either leave them empty or pass there your API Key. JSON value goes to fields. This way you can create a custom documentIds, which you can later ref to, as you should know these. :slight_smile:

@Jaroslav_Krajca so you are not creating a data record but are doing it with the REST API data resource where the customDocumentId is then the Id you are referencing?

If you are willing to give me some tutoring :-), that’s what I try to achieve:

Page 1:
I am collecting data of nights I stay in a hotel

Then I am using the list function to display the list of nights I stayed in a hotel. When pushing onto one list item I will open the details page where I could modify or delete the hotelnight.

I managed to do this while using the local data resource, there it is easy. Then I tried to integrate it with firebase and here I am struggling.


Hey man,

seems like this is a bit different from the previous questions on yours, however, I would recommend to connect 2 alerts, one on each node from the CreateRecord node and display output of the create record. This is the way, I am debugging my routes.

Also in this case, if you want to create a custom document ID, you should have use the way I have described above. Therefore instead of “Create record” node, use “HTTP Request” node and fill the data as I described previously.

Please, let me know if you are struggling or does it work.

Looks like a few people are having similar issues, as I am struggling with pulling multiple single records. I hope you get your issue resolved. :slight_smile: