I’m working on an app feature that allows users to create a grouped order, like a shopping basket, which involves selecting various" SubFoodItems "and setting quantities for each. These selections are stored in two separate states/lists: one for the SubFoodItems and another for the Quantities.
The challenge I’m facing is in the workflow process where I need to schedule the creation of “SubFoodItem” records with the respective quantities and attach them to a BasketItem. The roadblock comes the Schedule API Workflow on a list, where I am unable to pass the corresponding “Quantity” for each “SubFoodItem” since it doesn’t allow for index referencing or passing a second correlated list.
Here’s the setup:
-When a user selects “SubFoodItems” and assigns “Quantities”, these are saved in two states: “SelectedSubFoodItems” (list of “SubFoodItem” data type) and -“SelectedQuantities” (list of numbers).
- Upon confirming their selection, an API workflow should be scheduled for each “SubFoodItem” to create a record, which includes calculating the total price based on the assigned “Quantity”.
-The created “SubFoodItems” should then be attached to a newly created “BasketItem”.
The main question is how to ensure that each “SubFoodItem” is created with the correct “Quantity” from the state list when the workflow runs for each item when each CS list is seperate from one another.