Working with Boolean fields in Bubble
Learn how to effectively use Boolean fields in Bubble to optimize your database management. Improve your app's efficiency and user experience with the simple but versatile Boolean field.
The custom state is the most powerful feature of Bubble but many beginners struggle in using them. Custom states are temporary values stored in the user’s browser. As they are stored in the user’s browser, they are unique for each user and are lost on page load/refresh. This makes them handy when you want to temporarily use some value but don’t require it to be saved in your database.
I use custom states on occasion even when I need to store those values to the database. I save all the values in custom states and make database changes collectively rather than making several database changes.
You can store the custom state on any element in Bubble. There is no benefit or disadvantage in picking any element to store these values. The only rule is that the element should always be on the page.
Even if you navigate to another page which has the same element as the one on the last page, you cannot use the value. As the value is lost whenever refresh/change the page. The only solution is passing the value through URL parameters. To learn more about how to use URL parameters, read here.
Bookmark
How to use URL parameters in Bubble.io
You can use URL parameters to pass information between pages and trigger workflows in Bubble.io.

This will open the Element inspector.

Assign a value to a custom state in Bubble
To assign a value, we need to use a workflow. Click any element which you want to trigger the workflow and in the workflow section, go to Element action - All Elements - Create a state.

Now select the element where you had created the Custom state and then its name. Any value that you assign now, will be temporarily stored and can be used where you can input Dynamic data.
To reset the custom state value, you can create a workflow and leave the value blank.
To use the custom state in Dynamic data, first, select the element where the custom state has been set then select the name from the list of options. I have a custom state ‘Name’ on a button and I want to display the value in a text field.

I first selected the button in the Dynamic data and then the custom state. This text element will now show the value of the custom state. You can use this stored value anywhere on the same page.
Bookmark
5 common mistakes to avoid when building with Bubble
Are you building with Bubble.io? Avoid these 5 common mistakes when building your Bubble.io app.
If you need some help with your Bubble app, hit me up at himanshu@nocodeassistant.com or follow me on Twitter
Continue reading
Learn how to effectively use Boolean fields in Bubble to optimize your database management. Improve your app's efficiency and user experience with the simple but versatile Boolean field.
This tutorial covers the steps to connect Airtable and perform operations on your Airtable data with Bubble.
Learn how to solve the problem of a slow app (without upgrading your server). 1. Use privacy rules 2. Reduce nested searches 3. Avoid advanced filters