Workload units optimization in forms

I have a form in my Bubble app where users fill out various fields, and when they click the save button I update each field in the database for the user data type. However, I noticed that if a user wants to update just one or two fields after the initial submission, clicking save still updates all fields. Iam a bit concerned about the workload units as i read in the bubble manual that updating or writing a thing takes around 0.5 WU which ultimately might add up to a lot.

Is there a way to only update fields that have changed instead of updating the entire record each time? Iam looking for solutions to reduce workload units

It doesn’t make a difference to the 0.5 WU charged for updating a thing if you update all fields or only 1 field, that charge is the same, but the difference is how many characters of data that are sent through, so there is minimal WU savings when updating 1 field versus many.

1 Like

so eventhough the user clicks on the save button which triggers the workflow of making changes to the user data type field, the workload units doesn’t take into account unless a changes is made by the user? or the workload units does take into account only for the changes made by the user?

There’s a cost of 0.5 WU for updating a thing in the database.

hey iam aware of that but what if the user triggers a changes (like clicking the save button) but any real changes weren’t made like in the form example i mentioned above. does it takes up workload units?

Have you tried it to see?

Out of interest, I just tried it…

And the answer isn’t exactly clear (like everything else to do with WU).

I had a single on-page WF to make changes to a thing (the thing already loaded on the page) and changing a single field.

When the field is changed and the button is clicked, the WU cost was as follows:

Make change to thing: 0.62 WU
Total WF cost: 1.63 WU

So, somewhere in amongst that is the 0.5 WU mentioned in the docs for making changes to a thing.

Presumably, there’s also an additional cost for retrieving the thing (although why it needs to be retrieved in order to update it I’ve no idea), and the rest must be for the amount of data being transferred (which in my case was 2 characters), although the docs don’t mention anything about data costs for making changes to a thing.

So (I suppose) that explains the 0.62 WU of making the changes.

But then there’s a whole additional 1.01 WU being added.

I assume 0.6 of that is for running the server action that makes the change (as every single server action has a cost of 0.6 WU), but where the additional 0.41 WU comes from is anyone’s guess.

So, despite the Docs stating that it costs 0.5 WU to make changes to a thing (which is not technically incorrect, just very misleading), in real terms it seams the actual minimum cost to make changes to a thing is 1.63 WU (more than 3 times what a casual reader of the docs might expect).



But… as for the question of whether you still get charged WU when there’s no actual change…

The answer is, Yes, you do… although I’m not sure what for.


Here’s a breakdown:


In this instance, the save button was clicked, triggering a Make changes to thing workflow to update the Thing - but the new value was exactly the same as the old value (so nothing actually changed).

In this case the WU cost was as follows:

Total Cost: 0.63 WU

So it appears as if the Make changes to a thing action did not run, but I was still charged for a server action running (even though the make changes to a thing action didn’t actually run), plus some additional WU presumably for data (but the mysterious 0.41 WU from last time was not incurred here).

So who knows what that’s all about…



So, to answer your question… yes, you will still incur WU cost when the save button is clicked, even if no actual changes are made, but it will be less than if actual changes were made.

(at least that’s according to the very simple tests I just ran).

3 Likes

Did you report this on this topic ? Transparency in WU Charges: Let’s Unite for More Clarity! - #50 by fede.bubble

Apologies for the late reply and thank you for the detailed explanation. It was very helpful :heart: