I’d like to understand the detailed calculations for Updates.
Suppose I’m using an app to implement the Bill of Materials feature.
All functionality uses a Glide table, with no external data updates.
One product has 47 semi-finished items.
Does this mean that every time I restock this product, I’ll consume 47 Updates?
That’s a loaded question because it depends on many factors. For your situation, it could be zero updates or several, but it depends on how you are updating the data. Generally with a Glide table you would not incur updates, but if you are using certain workflows, then it would. Workflows will tell you if an action incurs updates and how many per run.
Thank you for your reply!
I need to use the Loop function in the work flow to accomplish this.
If I need to deduct the quantity of 47 semi-finished products, that means I’ll need to use the Set Column Value function 47 times. I see in the image that each execution consumes one update.
Does this mean that each execution of the Loop function consumes 47 updates?
Yes, I believe that would be 47 updates, and actually more with the additional actions that incur updates as well. I think looping and performing IO that many times seems extreme. I would reconsider your approach and maybe use a relation or query plus a Rollup to get the number of items. Then you only need to increment once with 47 instead of 47 times with one.
Thank you for your reply!
I need to do this calculation because I need to calculate the exact quantity of each semi-finished product in detail.
For example, after I process product A, I consume semi-finished products B, C, and D.
Of course, I’ve also tried the relation and rollup you mentioned, but it doesn’t allow me to deduct the inventory of semi-finished products B, C, and D by clicking the replenish button for product A once.
Do you mean there isn’t a way to establish a relationship between product A and its child products B, C and D when you do the relation - rollup?
This might be a long con, but I think you can:
- Have a table to establish the relationship between parent and children products (e.g: 1 product A = 3 product C).
- Create a JSON for that relationship in said table.
- When you add a product A, you would have a multi relation to that table, and get back a JSON array of those “relationships”.
- From that, you can use JavaScript to return the final quantity of each child product based on product A’s quantity.
- In the children product’s table, establish a multi relation to all records where it would appear in the table where you log product A’s.
- Get back a JSON array of all children product calculations, and use Query JSON to sum all quantities matching the children product.
Hi! Thanks for your reply! I appreciate your suggestion! I’ll give it a try!
Hopefully it helps your case! It’s a complex setup, let me know if you have any questions.