/bubble-tutorials

How to build nested comments in Bubble

Learn how to build nested comments in Bubble with clear steps that boost app engagement and create smooth, structured discussion threads.

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 nested comments in Bubble

A nested comment system in Bubble works by giving every Comment its own field that points to its parent comment. Top‑level comments have the parent field empty. Replies store the Comment they belong to. Then you display them using a repeating group that searches for comments where Parent is empty, and inside each cell you place another repeating group that searches for comments whose Parent equals Current cell's Comment. This creates the nesting.

 

Data Structure

 

Create a data type Comment with these real Bubble fields:

  • Text (text)
  • Author (User)
  • Parent (Comment) — this is the key
  • Post (Post) — if your comments belong to a post

Top‑level comments have Parent = empty. Replies have Parent = the comment they're replying to.

 

Showing Nested Comments

 

Put a repeating group on the page. Its data source should be:

// Only top-level comments
Search for Comments
  constraints:
    Post = Current Page Post
    Parent is empty

Inside this repeating group cell, add:

  • A text element showing Current cell Comment's Text
  • A button “Reply” that sets a custom state like reply\_to = Current cell Comment
  • A second repeating group for replies

The replies repeating group’s data source:

// Children of the current comment
Search for Comments
  constraints:
    Parent = Current cell's Comment

This naturally nests as deep as you repeat the same pattern.

 

Creating Replies

 

When the user submits a reply:

// Create a new Comment
Text = Input Reply's value
Author = Current User
Post = Current Page Post
Parent = Custom state reply_to   // the comment being replied to

 

Key Bubble Tips

 

  • Use privacy rules so users can read comments from the correct posts only.
  • If nesting becomes very deep, limit how many levels you visually render to avoid heavy searches.
  • Always search “Parent = Current cell’s Comment” instead of storing lists — Bubble handles single references better.

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