Firestore 'users' collections showing null/empty

I'm trying to use my own and also the demo firestore collections template.

I've patched it all up and when I use the drop down to select the other collections it's showing some things but when I select 'users' nothing is showing up.

When I check Firestore, I notice that in the panel view, the items that aren't showing up are grey and the ones that are showing up are black.

So i'm assuming that because all the 'user' collection documents are grey, there is some security or something that is stopping me seeing it in retool.

But I can't find anything online as to what this is, how to modify it or even many others who have the same problem.

I have rules in my firestore that makes it so that you can't see it without also knowing the UID but surely there has to be a way to see it when you're trying to populate a table? I thought that integrating with firebase would have done something but so far nada.

And as I mentioned, no one else seems to have the issue so I'm hoping it's not an ultra esoteric issue.

Hey @arkonis :slight_smile:

Does this seem relevant by any chance?

The answer states that the gray text β€œis happening because that document doesn't exist. That document doesn't exist because you didn't create it. What you did do, was to create a sub-collection called under a document that never existed in the first place. In other words, you have just reserved an ID for a document in the "user" collection and then create a sub-collection under it.

One thing to remember, in Cloud Firestore documents, and sub-collections don't work the way filesystem files and directories usually work in an operating sytem. If you create a sub-collection under a document, it doesn't implicitly create any parent documents. Sub-collections are not tied in any way to a parent document.

If you want to correct that, you have to write at least a property that can hold a value inside 1 document.”

Thanks Victoria, this doesn't solve the problem but is very useful for investigating a solution! thank you! I'll post updates for anyone else coming this way with the same confusion.

thank you!!

Okay wonderful! So the article you linked I had stumbled across before but didn't understand. However, with help from support chat, I was able to get something that sort of worked but with a few tweaks I have something working.

For others who stumble across here looking for a way to do the following:

  • Have a list of firebase auth account.
  • Be able to click a user and have it display which documents they have in their collection.
  • see the data of those documents.

here is the way I managed to get it to work:

  1. I did this on the firebase demo retool thing. But added another query which was firebase auth to my user list.
  2. get the table there as follows:
{{ selectCollection.value != "users" ? : }}

This now uses the existing getCollections and getDocuments that are on the demo table and should display the users. Unless I've missed steps. It's been a long day. The editor window next to it should now display the user information when you click a user.

  1. Make another query. I called mine 'document' as a placeholder. It is a service type=firestore, action type 'query firestore' with the Collection or subcollection ID as follows:
users/{{ }}/blocks
  1. make a table which parses that stuff:
{{ }}

If my instructions were written out properly then it should now display which ever user's documents list that you select in the table above.

Thank you community channel for all the help getting here :smiley:

1 Like