We are creating a simple app that can be used by an instructor to schedule classes with students. The use case is as follows. This instructor creates a class at a given time e.g Sat 1pm and chooses an option for the class to repeat every week for the next three weeks. When the instructor hits the create class button, we would like to create a total of 4 class records in the database.
Is it possible to implement this in adalo ? Making the instructor enter the same information 4 times is a deal breaker in terms of usability. We are not looking at complicated scheduling patterns (like a google calendar) - just something simple that makes the user experience better.
Hi @authenticyogi, There are currently no loop functions available in Adalo to create some thing like βdo this x timesβ.
You can create it by using multiple Click Actions with a condition:
Create record β¦, if Counter = 1
β Counter = Counter +1
Create record β¦, if Counter = 2
β Counter = Counter +1
Create record β¦, if Counter = 3
β Counter = Counter +1
Create record β¦, if Counter = 4
β Counter = Counter +1
Not elegant, but doable. Depends on your use case, e.g. if you can restrict the number of iterations to a maximum.
Creating a Counter
As we do not have the option to use variables to keep and updated the counter value, I am using a collection to manage the counter:
Overall Flow
The overall flow looks like this:
The user enters start date and time, Title of the class, and number of repeating sessions (max 5 in this example).
We subtract 1 from the number of sessions.
Note that after we create the counter value in the first step, we can now reference the new record with New Counter.
4. Repeat steps 2 and 3
The maximum number of sessions we can create with one click depends on the number of repeating steps.
To have multiple users working at the same time you would need to have the counter in the User collection, which I skipped for this demo example.
As I said before, it is not a very elegant solution to simulate a loop.
Tomorrow August 4th, the new component marketplace will launch with a calendar component.
It is probably a good alternative to use the calendar component and let the user click on a date to create the schedule.