Learn Bubble with 500+ tutorials, courses & AI Assistant ✨

Limited time launch offer get $80 off today

0 days 0 hours 0 minutes 0 seconds
SAVE $80 NOW
Planet No Code logo
Bubble.io CoachingFounder MentoringSponsorships
LoginLearn Bubble.io

How to display an average rating with the Star Rating plugin

In this Bubble.io tutorial video we demonstrate the extra steps you'll need to take in order to display an average star ratings value that users can return to and update using the Bootstrap Star Rating Input visual element.

Join now $19/monthLearn more
Get 500+ tutorials, a No-Code AI Assistant, 4 premium courses, and everything you need to build faster!
How to display an average rating with the Star Rating plugin
Explore these topics...
Plugins
Database
Bootstrap Star Rating Input

With just this tutorial learn...

Unlock the power of star ratings: Learn how to display accurate averages and handle user inputs like a pro!

Master Bubble's database magic: Discover how to create a robust rating system that updates dynamically with each user interaction.

Transform your app's UX: Implement a dual star rating display that showcases both individual and average ratings effortlessly.

With membership you'll...

Learn how to build a ChatGPT Clone, Custom CRM for your business & SaaS Marketing website with Webflow & AI.

Unlock 500+ Bubble tutorial videos with AI powered Q&A.

Debug your Bubble app instantly with our custom trained No Code AI Assistant.

Join now $19/month
Risk-free! 14-day money-back guarantee. Cancel anytime.

Understanding the Star Rating Plugin in Bubble

Welcome to part two of our mini-series on how to use the star rating visual element in Bubble. In the previous video, we covered how to select this element from the Bubble plugin catalog, insert it into a page, and set it up so that a user can input a value (e.g., three and a half stars) which is then saved into the database and displayed on the page when it reloads.

Limitations of the Basic Star Rating Implementation

The shortcomings of this approach are that if another user were to come along and rate it one and a half stars, that value is saved into the database and becomes the rating, whereas we really want to display an average. We could use a "make rating into a list" approach, so we could have had the 4.5 value and the 2.5 value in that list and then displayed an average. However, the reason that's not ideal is that when a user changes their value, there's no way in Bubble to match the value that the user gave and then update that, so we would just end up with another value added to the ratings.

Creating a New Data Type for Ratings

To solve this, we need to create another data type. We'll call this "rating," and it only needs to have a few fields: the user who created it, the value (which is a number), and the product (of type product).

Setting Up the Workflow

Let's look at the workflow we currently have. This just saves the change into the database. We need to start somewhere, so when the star rating's value is changed, we need to create a new data type. We'll set the product to the current page product, and the rating value to the star rating's value.

Implementing Conditional Rating Creation

To prevent multiple ratings from the same user, we can add an "only when" statement. We'll do a search for ratings where the product equals the current page product and created by equals the current user. We'll only create a new rating if the count of this search is zero.

Updating Existing Ratings

For the case where a user is updating their existing rating, we'll create another workflow. This time, we'll update the rating when the count is not zero. We'll search for the rating where the product equals the current page product and created by equals the current user, then change the value to the new star rating value.

Displaying the Average Rating

To display the average rating on the front end, we'll need two star ratings: one that displays the average and one that displays what individual users have input. For the average rating, we'll disable it so users don't get confused. We'll set its initial content to do a search for ratings where the product equals the current page product, then take each item's value and average it.

Testing the Implementation

Let's test our implementation. When we change the rating to four stars, the average updates to four. When we change it back to 0.5 stars, the average becomes 0.5. This setup means that when other users come along and update the bottom value, the top value will accurately display an average of all the ratings for that product.

Conclusion

By implementing this system, we've created a more robust and accurate star rating feature in our Bubble app. Remember to label the two star ratings clearly to avoid confusion for your users. This approach allows for individual user ratings while maintaining an accurate average display for all users.

Table of contents

Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Your No-Code Journey Starts Here

The best way to learn Bubble.io?

Build No Code Confidently

No more delays. With 30+ hours of expert content, you’ll have the insights needed to build effectively.

Find every solution in one place

No more searching across platforms for tutorials. Our bundle has everything you need, with 500+ videos covering every feature and technique.

Dive deep into every detail

Get beyond the basics with comprehensive, in-depth courses & no code tutorials that empower you to create a feature-rich, professional app.

Monthly
Yearly
Member
Accelerate your Bubble app to launch
$99 / month
$19/month/mo
Includes:
500+ tutorials
4 premium courses
Find the right tutorial with our custom trained AI
New tutorials added each week
Cancel anytime
14 day money back
Join now
Member
Accelerate your Bubble app to launch
$990 / year
$149/year/mo
Includes:
500+ tutorials
4 premium courses
Find the right tutorial with our custom trained AI
New tutorials added each week
Cancel anytime
14 day money back
Join now

Frequently Asked Questions

Find answers to common questions about our courses, tutorials & content.

Do I need any coding experience?

No. Our Beginner Essentials course and AI No-Code Coach are designed for total newcomers. You’ll learn Bubble.io step by step - no coding required.

How does the AI No-Code Coach work?

Simply type your question in plain English, and our AI taps into the entire video library to recommend the exact lessons you need. It’s like having a personal instructor on demand.

How long can I access the content?

As long as you’re subscribed! With our monthly subscription, you get unlimited access to all 500+ videos, our growing course library, and the AI No-Code Coach.

What courses are included

Your subscription includes:

  • Bubble Beginner Essentials – Get up and running fast.
  • Build a ChatGPT Clone – Integrate AI into your no-code apps.
  • Build Your SaaS Website with AI – Learn to create a scalable startup site.
  • Develop a Custom CRM App in Bubble - Learn database relationships with a CRM.

Plus, new tutorials every week!

What if I get stuck on a lesson?

The AI No-Code Coach is your first stop for instant answers. If you need deeper help, you can book 1:1 Bubble coaching for expert guidance.

Do you offer a money-back guarantee?

Yes! If you don’t see real progress within 14 days, let us know, and we’ll issue a full refund—no questions asked.

Can I cancel anytime?

Absolutely. Your subscription is month-to-month, and you can cancel anytime—no lock-ins, no hidden fees.

What if I want more than just tutorials & courses?

Absolutely. Your subscription is month-to-month, and you can cancel anytime—no lock-ins, no hidden fees.

If you’re serious about building a successful SaaS startup, check out Mastery—our intensive mentorship program. Mastery goes beyond Bubble.io development and includes:

  1. 1:1 mentorship to fast-track your progress
  2. Marketing strategies tailored for no-code founders‍
  3. Product management insights to scale your startup‍
  4. Personalized support from experienced founders

‍

Still have questions?

Reach out to our dedicated team.

Contact
Services
Search Bubble TutorialsBubble.io CoursesBook Bubble.io CoachingApply for Mastery
Latest Bubble tutorials
Rerank Text By MEANING With Cohere In Bubble.io Step by Step!
Unlock RAG Providers for NO CODE AI App Development TODAY!
Better Tables with Built-in Search and Sort By in Bubble.io
Partnerships
Flusk.eu
VectorShift
Comnoco
Plumb
Toddle
Whereby
Get started with no code
AI Powered No Code AppsNo Code Web ScrapingBubble.io Plugin tutorialsBubble API Connector tutorialsStudent & Teacher DiscountBest tools for no coders
Follow us
Youtube
X
LinkedIn
Planet No Code logo
In partnership with
Queen Mary University of London Logo
© 2024 Planet No Code. All rights reserved.
Privacy PolicyTerms of ServiceCookies SettingsContact Us