Calculations behaviour
To help troubleshoot and ensure your calculations run smooth - here is some important specifics of the calculations engine:
- Podio calculations engine calculates each calculation field independently and each particular field is not aware of other calculations that might happen same time
- Calculations might happen same time. Podio API have multiple workers (machines) and they may execute calculations for different fields on same item at same time.
- Calculations might also happen one after another. All tasks for re-calculations are being added to queue. And if there is high load then it may take some time between different re-calculations.
- Podio calculations engine does not guarantee order of execution. Example: if field2 depends on field1 and field3 depends on field1, and field1 is updated, then Podio does not guarantee which field will be calculated first, field2 or field3. But, it guarantees that both field2 and field3 will be re-calculated.
- Podio calculations engine doesn't re-calculate already calculated field to prevent infinite loops. Example: field1 => field2 => field3 => field4 => field2 dependency won't update field2 second time because it was already updated inside same dependency chain.
//Podio Team
-
Hi Hanno,
what exactly do you want to achieve?
With a flow (Globiflow, not Podio Flow) you can transfer the result into a "normal" field (text, number, date) .
If you want the result in a calculation field in the other item the 2 items must be connected via a relationship field directly (or indirectly via a third item to which both other items are connected directly).
Rainer -
Hi, my use case is primarely trough the API. I have an item with calculated fields that fetch info from other items. Trough trail and error I found that the calculated items are not available right after creating the item suing the API.
I did not find any way of forcing a caclulation for a single item.
If I use calculated fields, I do need to know if/when they are available. I was hoping that the create webhook is synchronised with the calculation, meaning that only after the calculation the hook is fired.
My question: is there any way to force a calculation of an item, get notified/check if the calulation is done?
-
Hi Jasper, currently no way to force the calculation other than manually refreshing the calculated field inside the field template (adding an updating and saving) or triggering an update to the calculated field using the workflow automation engine (basic or advanced workflow automation) - however we are currently not offering a reliable way to notify you from the async background tasks completion. You can better "force" calculations using the PHP calculations in the advanced workflow solution on Premium plan if you have this available https://www.globiflow.com/. We are looking into improving reliability and speed of the calculations going forward but does not have an ETA.
-
You don't need GlobiFlow to systematically refresh calc fields.
Bold hack:
- create a "parent" app with only one item in it, featuring a number field which you call `refresh_calc` or something like that.
- among you apps in that workspace, select one which items are obligatory to reference from as many other apps as possible - e.g. if you have a "Years" app, each "Month" will need to reference a year, each "Ticket" will need to reference a month and so on
- put `@refresh_calc` in every calculation in the "Years" app you are afraid won't update, and create a calc field called `refresh_calc` which only replicates the `refresh_calc` value from the parent app
- put `@refresh_calc` in every calculation in the "Montsh" app you are afraid won't update , and create a calc field called `refresh_calc` which only replicates the `refresh_calc` value from the "Years" app -- and so on, you get the idea, until you have `refresh_calc` in each and every calc field which is suspicious with respect to non-updating.
- input an arbitrary number, e.g. 1, in you number field in the single item in the parent app. Wait a couple of minutes. Delete that number. All fields will have updatet twice then.
However, it's a shame that this is necessary. Fields not updating is a known bug since forever. Podio, find a solution!
Maybe it will give you a motivational kick when you realize that my workaround might produce massive numbers of calculations eating up expensive resources on your server you will not be able to bill to the customer (no limits for that, right?).
Please sign in to leave a comment.
Comments
6 comments