/bubble-tutorials

How to build chat in Bubble

Learn how to build a real-time chat in Bubble with clear steps, tips, and tools to create a smooth, scalable messaging experience.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web or mobile app? RapidDev builds Bubble apps with your growth in mind.

Book a Free Consultation

How to build chat in Bubble

The simplest valid way to build chat in Bubble is to create a Conversation data type that stores the list of Users, and a Message data type that stores the text, sender, and the conversation it belongs to. Then on the page, you display a repeating group of Messages filtered by the selected Conversation, and you create new Messages through a workflow when the user sends text. This structure works for 1‑to‑1 and group chat, supports privacy rules, and scales much better than trying to store messages inside a list field.

 

Data structure

 

You need two main data types:

  • Conversation: fields
    • Participants (List of Users)
    • Last message (Message, optional, for speed)
  • Message: fields
    • Text (text)
    • Sender (User)
    • Conversation (Conversation)
    • Created Date (built‑in, used for sorting)

This keeps Messages as separate things so Bubble can load them progressively, which is important for chat performance.

 

Page UI

 

  • A repeating group with Type = Message.
  • Data source = Search for Messages with constraint Conversation = Parent group's Conversation, sorted by Created Date ascending.
  • Inside the RG cell, show Current cell's Message's Text and Sender.
  • An input box for typing messages and a Send button.

 

Send message workflow

 

When the user clicks Send:

  • Create a new Message:
    • Text = Input's value
    • Sender = Current User
    • Conversation = Current page's Conversation
  • Clear the input value.
  • (Optional) Make changes to Conversation → Last message = Result of step 1.

 

Privacy rules

 

On Message and Conversation, create a rule:

  • When This Conversation's Participants contains Current User → allow view.
  • Same condition on Message (via This Message's Conversation's Participants).

This ensures only participants can load each other’s messages.

 

Auto-scroll

 

Use the repeating group property Scroll to bottom (with a workflow action Scroll to entry: last item) after a message is created so the user always sees the newest messages.

 

// Example workflow comment (not code executed in Bubble):
// After creating a Message → Scroll to repeating group's last item

Explore More Valuable No-Code Resources

How to integrate Bubble.io with Git?

Learn how to seamlessly integrate Bubble.io with Git through our comprehensive step-by-step guide. Perfect for beginners and professionals.

Explore

How to integrate Bubble.io with Reddit Ads?

Learn how to seamlessly integrate Bubble.io with Reddit Ads using our easy step-by-step guide. Boost your ad management today!

Explore

How to integrate Bubble.io with AWS S3?

Explore our step-by-step guide on integrating Bubble.io with AWS S3, making your app development process more efficient and secure.

Explore

How to integrate Bubble.io with Lucidchart?

Follow our step-by-step guide to seamlessly integrate Bubble.io with Lucidchart, enhancing your workflow & productivity.

Explore

How to integrate Bubble.io with Kentico?

Learn how to seamlessly integrate Bubble.io and Kentico with our comprehensive, easy to follow step-by-step guide.

Explore

How to integrate Bubble.io with Box?

Discover easy-to-follow steps for integrating Bubble.io with Box. Boost your workflow and secure your files seamlessly today.

Explore

Stuck in Bubble.io? We’re here to help!

Fix broken workflows | Optimize logic | Boost performance | Scale with confidence

4.9
Clutch rating 🌟
600+
Happy partners
17+
Countries served
190+
Team members

By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.

Cookie preferences