Learn Bubble with 500+ tutorials, courses & AI Assistant ✨

Limited time launch offer get $80 off today

0 days 0 hours 0 minutes 0 seconds
SAVE $80 NOW
Planet No Code logo
Bubble.io CoachingFounder MentoringSponsorships
LoginLearn Bubble.io

Using Custom States to Store the Last Viewed Page When Refresh

In this Bubble.io tutorial video we demonstrate how to convert a menu that uses Custom States to hide and show parts of your page to a menu that uses a User database field. We explain the advantages of saving the current view to the User to maintain a consistent user experience.

Join now $19/monthLearn more
Get 500+ tutorials, a No-Code AI Assistant, 4 premium courses, and everything you need to build faster!
Using Custom States to Store the Last Viewed Page When Refresh
Explore these topics...
Database
Custom States

With just this tutorial learn...

Unlock the power of custom states: Learn how to build a seamless one-page app with persistent navigation, even after page refresh!

Master user experience: Discover how to store and retrieve the last viewed page, creating a smooth UX that keeps users engaged.

Transform your Bubble app: Elevate your navigation game with dynamic menu items and conditional statements.

With membership you'll...

Learn how to build a ChatGPT Clone, Custom CRM for your business & SaaS Marketing website with Webflow & AI.

Unlock 500+ Bubble tutorial videos with AI powered Q&A.

Debug your Bubble app instantly with our custom trained No Code AI Assistant.

Join now $19/month
Risk-free! 14-day money-back guarantee. Cancel anytime.

Using Custom States for One-Page App Navigation

This video is a direct follow-on from a previous video showing how to use custom states to build a one-page app and navigation. So this is using custom states, let's load in the page. And I have it set up to load in dashboard as the default value. And then I can toggle between my different screens for the user using this repeating group. But the shortfall here is that if my user is looking at my account and then let's say they refresh the page, they're taken back to dashboard.

Storing the Last Viewed Page

In this video, I'm going to demonstrate how to store this as a field within the user data type so that if they refresh the page, it remembers the display, the part of your app that they were looking at and it loads that in. So let's go into the UI builder. And first of all, I've got the menu set up as an option set with my different menu items here. And I'm now going to use it and create a field called viewing menu item. And then it's a type menu in order to make use of the option set. I'm not using a text value, I'm storing an option set.

Updating the Repeating Group

Let's go back to my repeating group which shows my menu option set. At the moment, this is set up to use custom states, but we're going to change that to data, make changes to current user. And then viewing menu item is, we're doing it dynamically, is current cell's menu. Okay, and then the only other things to update are the conditional statements on each of the groups here.

Setting Up Conditional Statements

As a reminder, in order to get the one-page effect, I have each of these set to not display on page loads and to collapse when hidden. But at the moment, they're set to use the custom state. So let's remove that. And instead, it's when current user views menu item is for this one dashboard. And then let's update this one. Current user viewing menu item is my account. And then let's have current user viewing menu item is billing. Okay, I think that's ready to test.

Handling Default Values

Okay, right, we've noticed the first little bug which you'd have to work out, which is before when I was using a custom state, I'd set a default value. One way around this, at least for new users registering for your app would be to go into data, use a viewing menu item, and then to choose my dashboard. So they have a value stored in there the moment they register, sorry, dashboard, yeah. So that when they visit this page in my app, I know that some data will be displayed to them.

Alternative Approach for Existing Users

Another workaround, let's say you've already got users registered, would be to add in another statement here. And that will be an or statement to say that when the current user viewing menu is empty, also show the elements. So if I get this to refresh, we should now see dashboard. So those are two approaches there to ensure that when a user visits this page, they're not met with a blank.

Testing the Implementation

And now when I click on these menu items here, it is updating the field in the user. And we can check that by going into, in fact, we can't because I was gonna say we could check that by going into data and looking at app users, but I'm not actually logged in currently. And so the, so Bubble is using a cookie to save data for me as current user, which if I was then to complete a registration workflow would be assigned to that user that I register.

Final Result

But so you can see this works just as well, even though I'm not logged in for storing data. And let's now refresh it. And you'll see, whereas custom states would jump back to the page on load state. Now it remembers the part of my one-page app that I was viewing.

Table of contents

Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Your No-Code Journey Starts Here

The best way to learn Bubble.io?

Build No Code Confidently

No more delays. With 30+ hours of expert content, you’ll have the insights needed to build effectively.

Find every solution in one place

No more searching across platforms for tutorials. Our bundle has everything you need, with 500+ videos covering every feature and technique.

Dive deep into every detail

Get beyond the basics with comprehensive, in-depth courses & no code tutorials that empower you to create a feature-rich, professional app.

Monthly
Yearly
Member
Accelerate your Bubble app to launch
$99 / month
$19/month/mo
Includes:
500+ tutorials
4 premium courses
Find the right tutorial with our custom trained AI
New tutorials added each week
Cancel anytime
14 day money back
Join now
Member
Accelerate your Bubble app to launch
$990 / year
$149/year/mo
Includes:
500+ tutorials
4 premium courses
Find the right tutorial with our custom trained AI
New tutorials added each week
Cancel anytime
14 day money back
Join now

Frequently Asked Questions

Find answers to common questions about our courses, tutorials & content.

Do I need any coding experience?

No. Our Beginner Essentials course and AI No-Code Coach are designed for total newcomers. You’ll learn Bubble.io step by step - no coding required.

How does the AI No-Code Coach work?

Simply type your question in plain English, and our AI taps into the entire video library to recommend the exact lessons you need. It’s like having a personal instructor on demand.

How long can I access the content?

As long as you’re subscribed! With our monthly subscription, you get unlimited access to all 500+ videos, our growing course library, and the AI No-Code Coach.

What courses are included

Your subscription includes:

  • Bubble Beginner Essentials – Get up and running fast.
  • Build a ChatGPT Clone – Integrate AI into your no-code apps.
  • Build Your SaaS Website with AI – Learn to create a scalable startup site.
  • Develop a Custom CRM App in Bubble - Learn database relationships with a CRM.

Plus, new tutorials every week!

What if I get stuck on a lesson?

The AI No-Code Coach is your first stop for instant answers. If you need deeper help, you can book 1:1 Bubble coaching for expert guidance.

Do you offer a money-back guarantee?

Yes! If you don’t see real progress within 14 days, let us know, and we’ll issue a full refund—no questions asked.

Can I cancel anytime?

Absolutely. Your subscription is month-to-month, and you can cancel anytime—no lock-ins, no hidden fees.

What if I want more than just tutorials & courses?

Absolutely. Your subscription is month-to-month, and you can cancel anytime—no lock-ins, no hidden fees.

If you’re serious about building a successful SaaS startup, check out Mastery—our intensive mentorship program. Mastery goes beyond Bubble.io development and includes:

  1. 1:1 mentorship to fast-track your progress
  2. Marketing strategies tailored for no-code founders‍
  3. Product management insights to scale your startup‍
  4. Personalized support from experienced founders

‍

Still have questions?

Reach out to our dedicated team.

Contact
Services
Search Bubble TutorialsBubble.io CoursesBook Bubble.io CoachingApply for Mastery
Latest Bubble tutorials
Rerank Text By MEANING With Cohere In Bubble.io Step by Step!
Unlock RAG Providers for NO CODE AI App Development TODAY!
Better Tables with Built-in Search and Sort By in Bubble.io
Partnerships
Flusk.eu
VectorShift
Comnoco
Plumb
Toddle
Whereby
Get started with no code
AI Powered No Code AppsNo Code Web ScrapingBubble.io Plugin tutorialsBubble API Connector tutorialsStudent & Teacher DiscountBest tools for no coders
Follow us
Youtube
X
LinkedIn
Planet No Code logo
In partnership with
Queen Mary University of London Logo
© 2024 Planet No Code. All rights reserved.
Privacy PolicyTerms of ServiceCookies SettingsContact Us