I have several issues with my app, that are all related to the same problem: Bubble seems to start an action before the previous action is finished. but I need the previous action to be finished, before the next starts:
in my app, users can choose a medical issue, based on which the app creates a list of suitable rehabilitation exercises for the user. The list is stored in the field User’s exercises (see screenshots).
Every day the user receives a shorter list of rehabilitation exercises that he should do on that day. This list is stored in the field Today’s exercises (see screenshot below ( also see screenshot for Data Type User and Exercise above)).
The list Today’s Exercises is created as described below. As indicated I have problems with most steps:
1. The list of the previous day is deleted - Problem: the action delete is not finished before the API workflow starts. This creates inconsistencies in the database.
**2. An API workflow is called that produces the new list. It takes the parameter User’s Exercises sorted by Number of times performed. (See screenshot below) ** - Problem: The API workflow starts, before the list is fully sorted. This way the API workflow takes the wrong exercises.
3. The API workflow takes a line fo the table User’s exercise and creates a new line of the table Today’s exercise.
The workflow has to fill 2 fields in each line of Today’s exercise: It needs to copy the exercise and calculate the variable total workout length in seconds (see screenshot)
Problem: The calculation of the variable total workout length in seconds requires the previous line of the table Today’s exercise, but sometimes it’s not yet there, because Bubble starts a new loop on the API workflow, before the previous line is finished. This causes to many lines and inconsistencies in my list Today’s exercise.
Note: the variable total workout length in seconds defines how long the final Todays Exercise list will be. The API workflow will stop once the desired total workout length in seconds is reached (e.g. 300 seconds).
Thank you so much for the help! Please let me know if I need to clarify something.