Update data in releted things

Hello Bubble fans.
In relation Board → Slots-> Tasks
how to update Slot.duration as SUM from all related Tasks:

I assume you’re asking how to update a field in the database? Rather than just display it on the page?

In either case, to get the sum of durations just do a search for Tasks who’s Slot is the related slot: each item’s Duration: Sum

Yes, problem for me is update of DB.
I can have correct value on the screen as text.

Well just save that value to the database. The expression will be the exact same one you use on the page.

Although, do you really need to be saving that vale to the database?

What is the purpose of that?

How to do this? Binded input field does not work in this. case.

No, you need to do it whenever a new task is created (or updated).

You mean as backend workflow with trigger?
I tried it so many hours without success.
It makes me crazy…

Not necessarily with a trigger… there’s probably no need to do that (although you can)… it depends on how many different places Tasks are created and updated.

But it should be simple.

Although, again, I’d question the need to do this at all, unless there’s a specific reason for it.

Why do you need this field stored in the database?

True is that:

  • will be often used and seems to be better to have it ready than calculate every time, so some optimalization with count once use many
  • second, maybe more important, my Bubble knowledge is not enough to make it works different way
1 Like

One main popup is collecting this information for Task. Without any OK button or something other States components. Is it a problem to Bubble?

Where is the right place to link workflow, so when somethig is changing at Task level to automaticly recalculate Slot duration?