Walk-Through: Using Hex Codes to Insert Colors as Dynamic Data

Follow this interactive tutorial to learn how you can store and use individual colors as dynamic data throughout your app.

Abhinav Narain
April 09, 2024 • 2 minute read
Walk-Through: Using Hex Codes to Insert Colors as Dynamic Data

You have a lot of freedom to customize your Bubble app’s database, including the fields that define each data type. And thanks to this blog post’s nifty trick, you can even assign each “thing” in your database its own hex-code color — which means you can use those colors as dynamic data throughout your page designs.

Click through the interactive tutorial below for an example of how you might use this trick while designing a team leaderboard for a fun trivia app.


To follow the walk-through, you’ll first want to add “Team” as a custom data type in your app. Then, on your leaderboard page, create a repeating group that displays a list of all teams. Each cell of the repeating group should display the team’s information (name, rank, and points) on a group card with a static background color. 

You’ll also want to add a button somewhere on the page that opens a popup where users can name a new team and add it to the database. With all that set up, you’ll have the foundation of your build set up, and you’re ready to follow the walk-through. 

We’re going to change the card’s background color so that it dynamically features the unique color of that cell’s team instead. First, you’ll need to modify the data structure of your Bubble app so you can assign colors to a custom team:

  • In the Data tab, create a custom field on your team data type called “TeamColor” that's type text (hex codes are simply a string of text).
  • Back in your repeating group, click the group that holds all of the Current cell’s Team’s information. 
  • Under Appearance, find the background color field and insert dynamic data: current cell’s Team’s TeamColor.

Now the group in each cell will pull in that team’s unique color. To make sure the “TeamColor” field is always populated with a hex code value, you’ll also want to expand the form where users create new teams:

  • Add an input for users to provide a hex code when creating a new team. You can use a simple input element for manual text entry or a color-picker plugin — in our walk-through example above, we did this by using Zeroqode’s Air Color Picker plugin.
  • In the workflow tab, whenever a user clicks the button to create their new team, save the color-picker input’s value as the “TeamColor.”

You’re all set! Now users can pick and save a unique color for their team and see it displayed with their team name on the leaderboard.

Start building with a free account

Build your app on Bubble's Free plan. No need to upgrade until you're ready to launch your app.

Join Bubble

LATEST STORIES

blog-thumbnail

Beyond the Vibes: Why AI App Building Needs More Than Just Good Intentions

Vibe coding might create impressive weekend demos, but building real businesses requires the transparency and control that only AI visual development can provide.

Emmanuel Straschnov
March 31, 2025 • 4 minute read
blog-thumbnail

Bubble vs. Replit Comparison: Which AI App Builder Is Right for You?

Bubble provides all-in-one AI app generation alongside a visual editor that gives anyone full control and customizability of their app. Replit provides an IDE alongside AI support for code generation, iteration, and debugging. Which is right for you? We analyzed 11 key factors to help you decide.

Bubble
March 28, 2025 • 29 minute read
blog-thumbnail

Bubble vs. Lovable Comparison: Which AI App Builder is Right for You?

Find the right no-code AI app builder for your project with our in-depth comparison of Bubble vs. Lovable, including app output, iteration quality, customization tools, technical experience needed, and more.

Bubble
March 18, 2025 • 28 minute read
blog-thumbnail

Bubble and Stripe Atlas Partner to Help Startup Founders

Entrepreneurs can access special perks by using Bubble and Stripe Atlas together for their startups

Cheyenne Blaisdell
March 04, 2025 • 2 minute read

What Can You Build on Bubble? 25 Examples to Inspire You

November 18, 2024 • 19 minute read

The Future of Bubble’s Editor: Introducing the New Workflow Tab

October 11, 2024 • 3 minute read

Efficient App Building 101: Improving Your Workload Usage

July 01, 2024 • 3 minute read

How to Craft Effective Prompts for Bubble’s New AI Page Designer

June 17, 2024 • 4 minute read

Build the next big thing with Bubble

Start building for free