Services Plugins FAQs

Calculation on sum of field Data Table / Grid

Hey there

Im summing values using Data Table / Grid and want to perform a math function on the result of the list of items. I want to convert from minutes to hours as a decimal

In the example site I change this to a text element but Bubble treats this as a list even though I’m summing the list eg

I then tried to format it like the calculated fields but get the following error

Any suggestions on how to approach this?

Hey @johnnyweb ,

Thanks for reaching out! :pray:

I see what you’re trying to do — you want to sum the “ShiftLength” in minutes and then convert that to hours as a decimal. The issue you’re facing is because Bubble is treating your sum as a list, even though you’ve done the aggregation.

Here’s a way to fix it:

  1. Change the Data Type of Column 4 to “number”:
  • This is the first step. Right now, you have it set to “text,” but since you’re working with numbers (converting minutes to hours), it needs to be set to “number.” This will allow Bubble to treat the result properly.
  1. Update the Data Source for Column 4:
  • For the data source, instead of just summing the “ShiftLength” and formatting it as text, try this:
Search for Shifts grouped by Employees sum of ShiftLength divided by 60
  • This will sum the “ShiftLength” values (in minutes) and then divide the total by 60 to convert it into hours.

Why This Works:

  • Dividing the summed minutes by 60 converts them into decimal hours, and using “number” as the data type ensures Bubble treats the result as a numeric value instead of a string. That way, you won’t get the error about needing a list of texts.

To Summarize:

  • Column 4’s Data Type: Change it to number.
  • Column 4’s Data Source: Set it to the sum of “ShiftLength” divided by 60.

This should do the trick and display the hours as decimals (e.g., 480 minutes becomes 8.00 hours).

If you’re still having issues or need further help, feel free to drop a message!

Cheers!
Support Team
Browse all Zeroqode Plugins for bubble
Banner_Last3

hi there @mina.rotari thanks for responding :smile:

I tried that but bubble sees the element as a list of items not the sum so I don’t have that operator available. Logic tells me thats what I want to have in there but I can’t see how to get bubble to put it in? How did you do this?

Thanks in advance!
John

Hi @johnnyweb ,

Thanks so much for getting back to me!

I just wanted to let you know that we’ve received your message and we’re currently looking into the behavior you’re seeing with Bubble treating the result as a list rather than the sum. I completely understand the situation you’re describing, and you’re right — logically, it should allow for that operation once set up correctly.

We’re reviewing it carefully and I’ll follow up with a more detailed response or workaround shortly. Thanks again for your patience — I really appreciate it!

Best Regards,
Support Team
Browse all Zeroqode Plugins for bubble
Banner_Last3

1 Like

Hey @johnnyweb,

Thanks so much for your patience!

We took a look at our demo page, and based on what we’ve seen, adding the “:split by” operator at the end of your expression should help solve the issue.

What you can do is modify your data source like this:

This will split the data into a list, and Bubble will be able to handle it properly for further processing.

Give that a try, and let me know if it works for you. If you’re still encountering any issues or if something’s unclear, feel free to reach out again, and I’ll be more than happy to help out further!

Looking forward to hearing how it goes!

Best regards,
Support Team
Browse all Zeroqode Plugins for bubble
Banner_Last3

1 Like

thank you @mina.rotari works like a charm.

I was also able to set this to sort as a number which works on screen and exporting to CSV -

Thank you so much!

Cheers -
John

1 Like

Hi @johnnyweb ,

I’m thrilled to hear everything is running smoothly now! :raised_hands: It’s always a pleasure to help, and we truly appreciate having you as part of our community.
​
If you’ve been enjoying our plugins, we’d love to hear your thoughts! Your feedback not only makes our day but also helps others in the Bubble community discover the best tools for their projects.
​
Leaving a quick 5-star review takes just a minute and makes a world of difference. Simply head to the Plugins tab in the Bubble editor, search for the plugin, and rate it! :star2:

Want to help even more? Share your experience on:
:link: Zeroqode Reviews
:link: G2
:link: Clutch
:link: Trustpilot
​
Your support means everything to us and helps us continue building awesome products for you! :rocket:
​
Thanks a ton, and have an amazing week ahead! :pray:
​
Best regards,
Support Team
Browse all Zeroqode Plugins for bubble
Banner_Last3

1 Like