Users collection - custom fields data not displaying

Database & APIs
Resolved

Hi all,

I added some custom fields to my users collection. They track a total for the user (e.g. 'daily_proteins'). I want to display that total on the user's dashboard and hence bound it to a text widget. But I cannot get it to display... Is it not possible in general to display custom fields? What am I missing?

Thank you for your help!

What have you tried so far?
  • Made sure the value can be found in Firebase.

  • Attempted read-rights for everyone.

  • Checked if predefined field would show: yes, userID for example is showing.

Here are my rules:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /users/{document} {
      allow create: if request.auth.uid == document;
      allow read: if true;
      allow write: if request.auth.uid == document;
      allow delete: if false;
    }

    match /meals/{document} {
      allow create: if request.resource.data.meal_user == /databases/$(database)/documents/users/$(request.auth.uid);
      allow read: if resource.data.meal_user == /databases/$(database)/documents/users/$(request.auth.uid);
      allow write: if resource.data.meal_user == /databases/$(database)/documents/users/$(request.auth.uid);
      allow delete: if resource.data.meal_user == /databases/$(database)/documents/users/$(request.auth.uid);
    }

    match /onboarding_options/{document} {
      allow create: if false;
      allow read: if true;
      allow write: if false;
      allow delete: if false;
    }

    match /company_information/{document} {
      allow create: if false;
      allow read: if request.auth != null;
      allow write: if false;
      allow delete: if false;
    }

    match /feedback/{document} {
      allow create: if request.auth != null;
      allow read: if false;
      allow write: if false;
      allow delete: if false;
    }

    match /support_center/{document} {
      allow create: if false;
      allow read: if request.auth != null;
      allow write: if false;
      allow delete: if false;
    }

    match /totals/{document} {
      allow create: if request.resource.data.user == /databases/$(database)/documents/users/$(request.auth.uid);
      allow read: if resource.data.user == /databases/$(database)/documents/users/$(request.auth.uid);
      allow write: if resource.data.user == /databases/$(database)/documents/users/$(request.auth.uid);
      allow delete: if resource.data.user == /databases/$(database)/documents/users/$(request.auth.uid);
    }
  }
}
Did you check FlutterFlow's Documentation for this topic?
Yes
2
7 replies