Walk-Through: How to Use the ‘:formatted as text’ Operator

Learn how to write if/else statements directly in the expression composer to show context-driven information — without conditionals.

Abhinav Narain
May 14, 2024 • 2 minute read
Walk-Through: How to Use the ‘:formatted as text’ Operator

Imagine this: You’re building an app with multiple role types and permissions, and you want to surface unique details associated with a set of information to different user types. With Bubble, you could set up a series of conditional statements to accomplish this — or you could use the :formatted as text operator.

The :formatted as text operator allows you to configure the text displayed anywhere a dynamic expression can be distilled down to a yes/no value. In traditional programming, this is known as a boolean.

Let’s explore how you might use :formatted as text in real life. Use these steps to follow along with the tutorial above.

  • Let’s say we’re building a dashboard that displays users on a team. Instead of showing the same information to every team member, we want to add contextual value for the specific user navigating the page. With the :formatted as text operator, we can craft elaborate, dynamic expressions to offer greater insight for the user.
  • As an example, we’ll change the text shown in the Team Members repeating group to display a greater variety of dynamic data.
  • Right now, the cell’s text only displays the user’s first name. But what if we want the Current User to see their own card more clearly? Or what if we want to show which users are admins? 
  • Instead of writing multiple conditionals — which could become tedious to manage — we can use the :formatted as text operator.
  • This operator lets us vary what text is displayed anywhere a dynamic expression evaluates a yes/no value — otherwise known as a boolean in traditional programming.
  • If yes (meaning the card’s user is the Current User), we can have the text say, “You.” If no, we can display the user’s full name.
  • The superpower of this operator is that we can now group or nest if/else statements together. For example, we can add an additional if/else statement to see if another user is the team admin. If so, we can display that info accordingly.
  • If we don’t want the no condition to add anything, we can leave the formatting input blank.

Happy building!

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

Top 2025 Web Design Trends to Know: Parallax Scrolling, Micro-animations, and More

Web designers are moving away from flat, minimalist aesthetics. Learn how they’re leaning into bolder, personality-packed experiences with the use of AI, non-traditional scrolling, bold colors and typography, and more.

Bubble
December 13, 2024 • 10 minute read
blog-thumbnail

Bubble Wrapped 2024: Our Top Moments, Your Best Builds, and More

That’s a (Bubble) wrap on 2024! Check out our collective year in review, including all the highlights of our community’s biggest accomplishments — from new product improvements to no-code topics you couldn’t stop talking about.

Bubble
December 13, 2024 • 5 minute read
blog-thumbnail

27+ SaaS Stats on Market Growth, Usage, Launching a SaaS Startup, and More

SaaS spend and growth is up in 2024, even though growth rates have cooled slightly from previous years. Get the details on why, the state of the SaaS market, and more in this roundup of stats you should know.

Bubble
December 11, 2024 • 11 minute read
blog-thumbnail

Bubble vs. Glide: Comparing the Top No-Code Platforms

Glide is great for a quick, out-of-the-box, no-code solution when you need less customization. However, Bubble offers much stronger customization, community, and versatility. Here’s our comparison of both platforms.

Bubble
December 11, 2024 • 24 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