Bravo Studio Help Center
  • Get started with Bravo Studio 👏
  • Get Started
    • 🚀Create your first app
    • 🌟Bravo introduction
      • Get ready to create your app with ChatGPT
      • Create an app
        • Creating an app with Figma
        • Creating an app with Adobe XD
      • Duplicate an app
      • Delete an app
      • Replace linked Figma file
      • The app page
      • Sharing your app
      • Add an editor to your app
      • Fonts
        • Adobe XD - Supported fonts
    • 📱Bravo Vision previewer
    • ✨Unlock power features to create interactive apps
    • 🎓Help and tutorials
      • 📖App guide tutorials
        • Sample app tutorial: Your first binding
        • How to build a Fitness app with Bravo, Xano and RevenueCat
        • Foodgram: Social content sharing
        • Expedition journal: Write and share your adventures
        • My Subscriptions: Display data based on device ID
        • My Notes: using user ID and email from Firebase
        • My Store: Sell physical products with Bravo and Stripe
        • Titan: How to create a Smart Home App with No-Code?
        • n8n: Building an expense tracking app in 10min
      • 📺Learn with videos
      • 📚Learn with articles
      • 🗃️Browse by app feature
        • Save or "bookmark" a page
        • Backend search with Airtable
        • Backend search with Xano
        • Nested lists (list within a list)
        • Create and edit user profile (Firebase + Airtable)
        • Skeleton loader
        • Create albums in your app with Bravo Infinite images
  • Set up your design
    • 🖌️Get your Figma ready for Bravo
      • 🗃️Structuring the design: the layer hierarchy
      • 🪄Bravo Tags: adding functionality to the UI elements
      • 🧱The container
        • Setting up a container on Figma
        • Setting up a container on Adobe XD
      • 📲App navigation
        • Setting up app navigation on Figma
        • Setting up app navigation on Adobe XD
    • 🔌Bravo plugin for Figma
    • 💾Sample design files
    • 🤓Best Practices
  • App components
    • 📒Bravo Tags Master List
    • 🚪Menus
      • Modal Menu
      • Modal pages
      • Tabs Menu
      • Pop Up pages
      • Slide Menu
    • 🍞Pages
      • Modal pages
      • Pop-up pages
      • Swipe page
      • Transitions page
      • Page reveal animations
      • Page tabs
      • 🔮Stateful pages
    • 📦Containers
      • Swipe to delete
      • Top bar
      • Carousel slider
      • Aspect ratio relative to screen
      • Sortable List
      • Layer (sticky element)
    • 👋Intro & Onboarding
      • Intro page
      • Post-login page (Onboarding)
    • ⌛Loading experience
      • Loading page
      • Custom loading page
      • No loading
      • Preload
    • 📝Form & input fields
      • 👁️Password Visibility Toggle
      • 🩷Stateful input
        • ☑️Checkboxes (Multiple select)
        • ✅Required Checkbox
        • 🔘Radio buttons (Single select)
      • ⏳Input time Interval
      • 📄Dropdown selector
      • 🎚️Slider control
      • 🗓️Calendar picker
      • 📄Send form input to a database
    • 💎Components
      • Autoplay Video
      • GIF
      • SVG Component
      • Web view
      • Web Components using AI
      • Web view communication
      • LottieFile
      • Lottie-animated component
      • Flexible text (Flexo)
      • Zoomable image
      • Component states
      • Stateful component (like button)
      • Setting up the backend of Stateful component (like button)
      • Haptic Feedback (Buzzz)
      • Progress bar
      • Rich text
      • Date, Time and Currency Formatter
      • Scrollable text
      • Text Lines & Truncation
      • Status bar
    • ⚡Mobile actions
      • Mobile Actions
      • Play audio
      • Record audio
      • Play video
      • Scan QR code (external URL)
      • Scan codes (remote action)
      • Search & filter
      • Refresh page
      • Share location
    • 📱App Icon & Splash Screen
    • 🗺️Map with markers
    • 📈Charts
  • Data and Backend
    • 🗂️Set up a no-code backend
      • Xano
        • Nested lists (list > list > detail page) with Xano
        • Create a bookmark functionality with remote actions and device ID with Xano
        • Multi-user setup with Xano
        • 🔒Setting up the Xano Log in Snippet
          • ♻️Refresh Token
      • Airtable
        • Nested lists (list > list > detail page) with Airtable
        • Sort list with Airtable
        • Connect multiple tables from Airtable to one app
        • Update Airtable's API key to Access Token
      • Backendless
      • Bubble
      • Notion
        • Getting data from a Notion table
      • Firebase
        • Getting data from Firestore
    • 💾Set up API requests
      • Set up from scratch
        • Airtable
          • Set up an API GET request for list page - Airtable
          • Set up an API GET request for detail page - Airtable
          • Set up an API POST request - Airtable
          • Set up an API DELETE request - Airtable
        • Xano
          • Set up an API GET request for list page - Xano
          • Set up an API GET request for detail page - Xano
          • Set up an API PATCH request - Xano
          • Set up an API POST request - Xano
          • Set up an API DELETE request - Xano
      • Using GraphQL body type
      • Set up with API wizard & importer
        • Using the Airtable API Wizard
        • Using the Xano API wizard
    • 🎲Variables
      • Built-in variables
      • Set Variable
    • 📚Data Collection & Binding: Complete Collection
    • 🗂️Pagination
    • 🐛Debugging API issues
      • ⚙️Debugging requests in the API Collection
      • 📲Event logger
      • 🔗Link property
  • Data binding
    • 🤝Data binding types
      • API binding types
      • Bind multiple API requests to one screen
      • How to connect my API to a mobile actions
      • Remote actions: trigger an API request with a UI element
    • 💡Display data in your app
      • Bind data to design for a list page
      • Bind data to design for a detail page
    • 🆕Create data from your app
    • 🗑️Delete data from your app
    • 🚦Conditional Visibility
    • 🎛️Conditional Actions
  • Integrations & Settings
    • 🖇️Deep Links
      • 🖇️Deep Links for Bravo Vision
      • 🖇️Deep Links for published apps
      • 🖇️Troubleshooting Deep Links
    • 🔔Push Notifications with OneSignal
      • How to get a Bravo page URL
    • ⚙️Firebase Configuration
    • 🔐User Authentication
      • 🔑Authentication with Kinde and Xano
      • 🧙🏽Authentication with OAuth 2.0
        • Using social logins to authenticate users
        • Using AWS Cognito to authenticate users
        • Connecting to Spotify API
      • 📲User login with Firebase
        • ✉️Email and password Login with Firebase
        • 📞Phone Login with Firebase
        • 🍎Social Login with Firebase
        • 👻Anonymous Login with Firebase
      • ⛓️Authentication with custom backend
        • Set up Xano as your user authentication backend
    • 💰Stripe: One-time Payment
    • 💬Chat: CometChat
    • 💸RevenueCat: In-app purchases and subscriptions
    • 📉Bravo Analytics
    • 📳Facebook App Events
    • 📊Google Analytics
    • 🌐Multilingual apps
    • 🕸️How to connect with Webflow API
    • 📡NFC connection
    • 🎯Admob
  • App Publication
    • 🚀Publishing your app
      • iOS Publication: Complete Process
        • 1. Generate Certificates, AppIDs and Provisions
        • 2. Get the IPA
        • 3. Upload IPA to App Store Connect
        • 4. Test your app on TestFlight (optional)
        • 6. App Store publication
        • 7. Updating an app in the App Store
      • Android Publication: Complete Process
        • 1. Create a Keystore File (optional)
        • 2. Get the Debug APK to install
        • 3. Install the Debug APK in your device
        • 4. Get the AAB (Android App Bundle) file to publish
        • 5. Google Play publication
        • 6. Updating an app in Google Play
      • Android APK Installation Guide
      • Rejection from the app stores
    • 🎛️Making changes to your app after publication
    • 🛍️Versioning
    • 🌟App rating alert
  • Good to Know
    • 🤔Troubleshoot
      • Errors when logging in
      • Errors when creating an app
      • Errors in API requests
        • Request timeouts on Bravo
      • Errors after importing
      • Errors in publication form
    • 🧑‍💻Manage your account
    • 💳Billing
      • Bravo Subscription Plans Overview
      • App Add-ons
      • Upgrading a plan
      • Downgrading a plan
      • App allowance
      • Invoices & payment method
      • FAQ
    • ❓FAQs
      • About Bravo Studio
      • Importing a design file
      • Bravo Vision
      • Bravo Tags
      • API & Data Library
      • Login & Account
      • Other Features
  • NEED SOME HELP?
    • 📖Bravo Support Guide
    • 🤝Join the Bravo community
    • 🤖Bravo Assistant
    • 👥Production support
    • 🐞Report an issue
Powered by GitBook
On this page
  • ✨ Features
  • 💎 Resources
  • 1️⃣ Set up authentication with Firebase
  • 2️⃣ Create the data collection and requests in the Data Library
  • GET List Notes
  • GET Get User Email
  • POST Add Note
  • 3️⃣ Bind the screens to the data
  • Home screen
  • Notes screen
  • Add note screen

Was this helpful?

  1. Get Started
  2. Help and tutorials
  3. App guide tutorials

My Notes: using user ID and email from Firebase

PreviousMy Subscriptions: Display data based on device IDNextMy Store: Sell physical products with Bravo and Stripe

Last updated 3 years ago

Was this helpful?

In this tutorial, you'll learn how to set the user.id and user.email. The values of these variables are taken from an authentication provider, so the app must authenticate the users first in order to get these values.

To showcase this, we'll create a sample notes app. In this app, we'll set up an authentication flow and connect it to Firebase. Then, we'll use Airtable to store the user-related data. In order to show each user only their notes, we'll use the user.id value when storing a new note in the table. Finally, we'll set up a personalised message, where the user will see their own email as part of a greeting message.

For this personalised message, another (user.name) could be used. Currently, this is not possible with Firebase, as it doesn't fill the value for this variable. When new authentication providers are integrated with Bravo, this variable will also have a value.

✨ Features

  • User authentication with Firebase.

  • Display a welcome message for the user with their email address.

  • View, add, and remove notes, leveraging the user.id variable to show each user only their notes.

💎 Resources

  • Design file: Figma

  • Data source: Airtable

    Open the Airtable and click Copy Base to duplicate to your account.

    Includes

    • Table setup for the notes, user id and user email.

1️⃣ Set up authentication with Firebase

2️⃣ Create the data collection and requests in the Data Library

Now, we'll create a Data Collection in the Data Library, to connect our API with Airtable, and to display the welcoming message with the user.email variable. We'll use the Airtable wizard when adding the API endpoint tutorial to speed things up - we'll need to provide the Airtable base URL and the API Key of our account.

Once the Data Collection has been created, we'll configure three API requests. These are detailed below.

You can duplicate the requests generated by the Airtable tutorial in order to create new ones. This way, the Authentication value with the API key will be already copied in the request header.

GET List Notes

In this request, we'll get the list of notes from Airtable. However, we don't get all the notes, but only the ones that are associated with a certain user.id. The value for this variable will be filled once the user is logged in, so each user will only be able to see their own notes.

In order to set up this request, follow these steps:

  1. Set the following request URL

     https://api.airtable.com/v0/**BASE_ID**/**TABLE_NAME**?filterByFormula={userid}='${user.id}'

    Note that the BASE_ID and TABLE_NAME values will be custom for your own Airtable base and table name. These are found in the request URL generated by the Airtable tutorial.

  2. In the Parameters tab, set the parameter key user.id with the value test_id (this is the value we have in our Airtable base for the three sample notes). Then, hit Send. This will return the three sample notes.

  3. In the Received Data tab, make sure all these data records below are selected. This will allow us to bind the data later in the screens.

GET Get User Email

In order to set up this request, follow these steps:

1. Set the following request URL

https://httpbin.org/get?name=${user.email}

This will send the user.email variable to the httpbin service as a query parameter, and get that value back in the response body (received data).

2. In the Parameters tab, set the parameter user.email with the value user_test (just a sample value, you can use any value you wish). Then, hit Send. We need to do this in order to configure the request for later use in our app.

3. Finally, in the Received Data tab, select the .data.args.name **parameter. You'll see here the value you set as a parameter before sending the request. This will be the parameter that we'll bind to the home screen later, to display the welcome message with the user email.

POST Add Note

Finally, we'll set up a POST request to be able to add a note. In the request body, we'll add the note content and the user.id variables, respecting the structure that we created in Airtable.

In order to set up this request, follow these steps:

1. Set the following request URL:

 https://api.airtable.com/v0/**BASE_ID**/**TABLE_NAME**

2. In the Body tab, select JSON, and copy the following JSON body. In this body, we defined the noteContent and user.id variables with the dollar sign and the brackets. The noteContent variable value will be fetched later from one of the screens, and the user.id will be automatically filled in by Bravo with the user.id value.

 {
   "records": [
     {
       "fields": {
         "note": "${noteContent}",
         "userid": "${user.id}"
       }
     }
   ]
 }

It's very important to respect the naming that is set in Airtable. The "note" and "userid" key names are also the names of the colums in the Airtable base provided for this tutorial. If you change those names, you must change the key names in the JSON body as well. Otherwise, there will be an HTTP error when sending the request.

3. Now, as we did for the previous requests, we need to set test values for the variables we defined for this request (noteContent and user.id). In the Parameters tab, set those test parameters to any value you wish.

Then, hit Send. You should see the test parameters you have set both in the Airtable base and in the Received Data tab. We'll not need any of those values that we get in the response (recall that we have set a List Notes request to display all the notes), you can just leave it as it is.

3️⃣ Bind the screens to the data

Finally, we can bind the screens that we imported from Figma to the data by using the API requests we just set. We'll want to bind the Home, Add note and Notes pages with the Get User Email, Add Note and List Notes requests, respectively.

Home screen

In this screen, we want to fetch the user.email variable to display a welcome message. We'll use the API request we specifically created for this, with the httpbin service.

  1. In your Bravo project, click on the Home app page to open the Data Binding mode. Then, select the Data Collection we created (the group of API requests), and select the Get User Email request.

  2. Select the User text element in the greeting frame, and bind it to the variable containing the user email. The name of this variable is set in the Selected Data tab of the Data Library, go there and check it out if you're not sure of which variable you should select.

Notes screen

This screen will be the one listing all the user notes. Therefore, we must bind it to the List Notes request we set up before.

  1. In your Bravo project, click on the Notes app page to open Data Binding mode. Then, select the Data Collection we created, and select the List Notes request.

  2. Bind the Notes container to the Records value on the right pane, and the Note text element inside to the variable representing the note content (remember that this is set in the Selected Data tab of the Data Library).

If you preview on Bravo Vision now, this page will appear empty because you have not yet added any notes under your user ID. Add an empty page state to visually inform your users.

Add note screen

Finally, we'll bind the Add note screen to the Add Note request, so that the user can add new notes.

  1. In your Bravo project, click on the Add note app page. Then, select the Data Collection we created, and select the Add Note request.

  2. Select the Add note... text form field inside of the main container, and bind it to the noteContent variable we defined in the JSON body of the Add Note request.

  3. Finally, in the Response Actions pane, under On Success, select Go To Page, and choose the Notes page. This way, the app will navigate to the Notes screen after the user submits a new note. You can also set up a message to display in case an error occurs when sending the note.

That's it! 🥳

Once the design file has been imported into Bravo, follow in order to set up the authentication with Firebase.

This will be a special request to be able to display the user.email variable in the welcoming message. As Bravo binds the data that comes from an API, we first need to send the user.email variable to an API service once the user is logged in, then fetch it from that API to display it on the screen. There's a service called that allows you to create a request URL with a certain parameter, that will trigger a response containing that same parameter. This way, we can send the user.email variable to the httpbin service, and fetch it again using the same GET request.

🎓
📖
this tutorial
httpbin
Bravo variables
Bravo variable