This is a difficult one for me to explain but ill try.
I am trying to run a workflow on the first input shown (recipe qty circled in red) that multiplies the original item input qty which is shown further down (circled in black).
This should run the calculation of recipe qty * original item qty to the calculated item qty (circled in green).
I have a table view called item_recipe_link which has the recipe qty, original item qty and another one I am calling calculated qty.
The issue I have is that the recipe qty belongs to the recipe table so I can’t access the data from the children below (which are the items) to run the calculation.
See image below which also has the description in it.
I want to write the data. The issue is that the recipe input where i put the workflow is in one table but where I want to write the data is in another table. I can write a single value to each line by using a custom filter but i can’t write different values using a calculation.
This what i have currently.
The item_in_recipe_link table is a relationship to link the items to the recipe.
Column* - This is column I am using to filter the item_in_recipe_link table (the table with the purple values is the recipe table)
This is the item_in_recipe_link table. The item_in_recipe_qty needs to be multiplied by the recipe_qty value from the workflow. The issue I have is how do I apply this calculation to multiple records in the item_in_recipe_link table when they match the filters I apply.
The only part I’m struggling with is how to update multiple records in Supabase. That’s easy if I want to write the same value to each record but I am trying to write different values to each record.
I am assuming there will be some way to do it using index but I just don’t know how.
I figured this out by myself. I ended up just using a loop using the length of the filtered array.
It was much easier for me to break it down step by step rather than trying to update in bulk.
The main revelation for me was the fact that you can specify the number within the filtered array.
I just added 1 to that variable each time to filter through each item in the array.