Set up a discussion forum in Bubble by creating Data Types for Categories, Topics, and Replies with proper relationships. Build a category listing page, a topic list with pagination, a topic detail page showing threaded replies, and posting workflows. Add basic moderation tools like pinning topics and flagging content to keep discussions productive.
Setting Up a Discussion Forum in Bubble
A discussion forum lets users post questions, share ideas, and have conversations organized by categories. This tutorial walks you through building a simple but functional forum in Bubble — from the data structure to the UI to the posting workflows. Perfect for community apps, support forums, or knowledge-sharing platforms where you need categorized, threaded discussions.
Prerequisites
- A Bubble account with an app open in the editor
- User authentication set up (sign up and login flows)
- Basic understanding of Data Types, Repeating Groups, and workflows
Step-by-step guide
Create the forum Data Types for categories, topics, and replies
Create the forum Data Types for categories, topics, and replies
Go to Data tab → Data types. Create 'ForumCategory' with fields: name (text), description (text), sort_order (number), icon (text). Create 'Topic' with fields: title (text), body (text), author (User), category (ForumCategory), is_pinned (yes/no), is_locked (yes/no), view_count (number), reply_count (number), last_activity (date). Create 'Reply' with fields: body (text), author (User), topic (Topic), created_date (date). The reply_count and last_activity fields on Topic are denormalized counters that you update via workflows for performance.
Expected result: Three Data Types (ForumCategory, Topic, Reply) are created with all relational fields.
Build the forum categories listing page
Build the forum categories listing page
Create a page called 'forum.' Add a Repeating Group with Type of content 'ForumCategory' and Data source 'Do a search for ForumCategories' sorted by sort_order. In each cell, display: the category name (Text, bold), description (Text, smaller), and a count of topics in that category (Do a search for Topics where category = Current cell's ForumCategory:count). Make each cell clickable: add a workflow 'When Repeating Group ForumCategory's cell is clicked → Go to page forum-category → send data: Current cell's ForumCategory.'
Expected result: The forum page shows all categories with their names, descriptions, and topic counts.
Build the topic listing page for each category
Build the topic listing page for each category
Create a page called 'forum-category' with Type of content set to ForumCategory. Add a heading that displays 'Current Page ForumCategory's name.' Add a Repeating Group with Type 'Topic' and Data source: 'Do a search for Topics where category = Current Page ForumCategory, sorted by is_pinned descending then last_activity descending.' This shows pinned topics first, then recent activity. In each cell, show: title, author name, reply_count, last_activity formatted as relative time, and a pin icon if is_pinned is yes. Add a 'New Topic' button at the top.
Pro tip: Set the Repeating Group to show 15-20 items per page and add page navigation buttons. Avoid loading all topics at once — forums can have thousands of topics.
Expected result: Clicking a category shows its topics sorted by pinned status and recent activity, with topic metadata visible.
Create the topic detail page with replies
Create the topic detail page with replies
Create a page called 'topic' with Type of content 'Topic.' Display the topic title (H1), body (multiline text), author name, and creation date at the top. Below, add a Repeating Group with Type 'Reply' and Data source: 'Do a search for Replies where topic = Current Page Topic, sorted by created_date ascending.' Each reply cell shows: author name, created_date, and body text. At the bottom, add a Multiline Input for composing a reply and a 'Post Reply' button.
Expected result: The topic page shows the original post followed by all replies in chronological order, with a reply form at the bottom.
Build the posting and reply workflows
Build the posting and reply workflows
For new topics: On the forum-category page, when 'New Topic' is clicked, show a popup with Input fields for title and a Multiline Input for body. When 'Submit' is clicked: Create a new thing Topic (title, body, author = Current User, category = Current Page ForumCategory, last_activity = Current date/time, reply_count = 0). Then Go to page 'topic' with data = Result of step 1. For replies: When 'Post Reply' is clicked on the topic page: Create a new thing Reply (body = Input's value, author = Current User, topic = Current Page Topic, created_date = Current date/time). Then Make changes to Current Page Topic: reply_count = reply_count + 1, last_activity = Current date/time. Reset the input.
Expected result: Users can create new topics and post replies, with topic metadata (reply count, last activity) updating automatically.
Add basic moderation tools for admins
Add basic moderation tools for admins
Add a 'role' field to the User Data Type if you have not already (text: admin, moderator, member). On the topic page, add conditional buttons visible only to admins: 'Pin Topic' (Make changes to Topic: is_pinned = yes), 'Lock Topic' (Make changes to Topic: is_locked = yes), and 'Delete Topic' (Delete thing: Topic, then Go to page forum-category). When a topic is locked, add a conditional on the reply form: 'When Current Page Topic's is_locked is yes → This element is not visible' and show a message 'This topic is locked.' Add a 'Flag' button on each reply that creates a 'Flag' Data Type record for moderator review.
Expected result: Admins can pin, lock, and delete topics. Users can flag inappropriate replies. Locked topics prevent new replies.
Complete working example
1DISCUSSION FORUM — DATA MODEL & WORKFLOWS2============================================34Data Types:5 ForumCategory: name, description, sort_order, icon6 Topic: title, body, author (User), category (ForumCategory),7 is_pinned (yes/no), is_locked (yes/no),8 view_count (number), reply_count (number),9 last_activity (date)10 Reply: body, author (User), topic (Topic), created_date11 Flag: content_type (text), content_id (text),12 reporter (User), reason (text), status (text)1314Pages:15 forum → category listing16 forum-category → topics in category (Type: ForumCategory)17 topic → topic detail with replies (Type: Topic)1819New Topic Workflow:20 Trigger: Button Submit in New Topic popup21 Action 1: Create Topic22 title = Input Title's value23 body = Multiline Body's value24 author = Current User25 category = Current Page ForumCategory26 last_activity = Current date/time27 reply_count = 028 Action 2: Go to page topic, data = Result of step 12930Post Reply Workflow:31 Trigger: Button Post Reply clicked32 Only when: Current Page Topic's is_locked is no33 Action 1: Create Reply34 body = Multiline Reply's value35 author = Current User36 topic = Current Page Topic37 created_date = Current date/time38 Action 2: Make changes to Current Page Topic39 reply_count = Current Page Topic's reply_count + 140 last_activity = Current date/time41 Action 3: Reset Multiline Reply input4243Moderation Workflows:44 Pin: Make changes to Topic → is_pinned = yes45 Lock: Make changes to Topic → is_locked = yes46 Delete: Delete Topic → Go to page forum-category47 Flag: Create Flag (content info, reporter, reason)Common mistakes when setting up a discussion forum in Bubble
Why it's a problem: Not denormalizing reply count and last activity on the Topic type
How to avoid: Add reply_count and last_activity fields to Topic and update them in the reply workflow using 'Make changes to a thing.'
Why it's a problem: Loading all replies at once without pagination
How to avoid: Set the replies Repeating Group to show 20-25 items per page and add 'Load more' or pagination buttons.
Why it's a problem: Using only client-side hiding for moderation controls
How to avoid: Use Privacy Rules on the Topic and Reply Data Types to restrict modification and deletion to admin roles at the database level.
Best practices
- Denormalize frequently-displayed counts (reply_count, view_count) on the Topic Data Type for performance
- Sort topics by is_pinned descending, then last_activity descending to show pinned topics first
- Paginate topic lists and reply lists to keep page loads fast
- Add Privacy Rules to restrict topic deletion and moderation to admin users
- Use a Flag Data Type for user reports instead of deleting content immediately
- Track view_count by incrementing it in a 'Page is loaded' workflow on the topic page
- Format dates as relative time ('2 hours ago') for a modern forum feel
Still stuck?
Copy one of these prompts to get a personalized, step-by-step explanation.
I want to build a discussion forum in Bubble.io with categories, topics, replies, and basic moderation. What Data Types do I need, how should I structure the topic listing with pinning and sorting, and how do I build the posting and reply workflows?
Build a discussion forum with ForumCategory, Topic, and Reply data types. Create a categories page, a topic list page sorted by pinned and recent activity, and a topic detail page with threaded replies. Add new topic and reply workflows, and include moderation controls for pinning, locking, and deleting topics.
Frequently asked questions
Can I add rich text formatting to forum posts?
Yes. Use a Rich Text Editor plugin (like the one from ZeroQode) instead of a plain Multiline Input. Store the HTML output in the body field and display it using a Rich Text element.
How do I prevent spam in the forum?
Add rate limiting by checking if Current User's last topic creation was less than 5 minutes ago. Also require email verification before allowing posts, and use the Flag system for community-driven moderation.
Can I add email notifications when someone replies to my topic?
Yes. In the reply workflow, add a 'Send email' action to the topic author's email. Include the reply text and a link back to the topic page.
How do I track how many times a topic has been viewed?
Add a 'Page is loaded' workflow on the topic page: Make changes to Current Page Topic → view_count = view_count + 1. Add an 'Only when' condition to exclude the topic author from incrementing their own view count.
Will a forum with thousands of topics perform well in Bubble?
Yes, with proper optimization. Use database constraints (not client-side filters), paginate Repeating Groups, and denormalize counts. Forums with tens of thousands of topics work fine when built correctly.
Can RapidDev help build a custom community forum?
Yes. RapidDev builds custom community platforms in Bubble with features like threaded discussions, reputation systems, advanced moderation, and real-time notifications.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation