Given now each user has theire own allocated server capacity, can Bubble add Loop function?
I personally find it very-very frustrating not to be able to loop things.
PLEASE ALLOW AT LEAST LIMITED LOOP, e.g. 500 rounds.
Thank you very much.
Alex
Given now each user has theire own allocated server capacity, can Bubble add Loop function?
I personally find it very-very frustrating not to be able to loop things.
PLEASE ALLOW AT LEAST LIMITED LOOP, e.g. 500 rounds.
Thank you very much.
Alex
Hi Alex,
Itās not obvious, but you can implement loops in Bubble.
Change 5 seconds to 0.001 seconds, or 0.0001 whatever.
Set up a condition on this workflow so that the loop is only running when condition āyā is true. You can then start and stop this loop by changing the condition y on and off based on incrementation or whatever.
I need that also in the API Workflow (when no browser is open).
Have you tried āSchedule API Workflow on a listā? You would need to get the items you want to loop through in a list and create an API workflow to perform the actions you need on each of them.
Thank you very much, interesting solution.
The problem here is that even 0.000001 is slow.
@emmanuel is there a chance for quicker āloopingā?
PS Loops would allow to go through a repeating group and change records from corresponding inputs (currently we have to allow auto-binding, i.e. call the server every time input is changed).
What exactly are you planning on looping that quickly that it canāt be done using a scheduled workflow?
For example, I want to schedule a sequence of events in calendar, where date of an event is dependent on a previous eventā¦
Example 2: I could loop through repeating groups and update them.
Do you know how many events you want to schedule in advance ?
That is the thing - I know between what dates I need to schedule my events and depending on the selected frequency, events are created (there is logic inbetween some of the events).
At the moment, I use ātemplateeā events (created in advance), which get copied and then amended according to set paraments. This takes ages: to schedule 10 sequences (50 events) takes 3-4 minutes. I could do that quicker in excel.
Can you use a set of date things, and update the relevant ones. That might be quicker ?
I do in fact use date* āthingsā, still, etakes time and quite a complicated workflow to implement the sequence
Also, if one event is changed by the user, the whole process (of using a complicated workflow) has to be done again.
If there was a loop function, I could just fly through records (things) and create/update them.
The other thing is updating repeating groups from inputs, any suggestion how to do that without allowing auto binding (in other words create duplicates of all fields)?
Thank you.
Hi again Alex,
The slowness comes from the operations you are carrying out within the loop, not the delay between iterations of the loop.
When the delay is set at 0.000001, for instance, you would need to execute the loop 1 million times before the cumulative delay between iterations of the loop equalled 1 second.
The delay has a very very minute effect on the speed at which you accomplish things through the loop.
If you are finding the loop to be slow, it is because operations being executed within that loop are slow. Bubbleās operations are just slow (creating things/changing things/ adding/ subtracting). That is especially true when using the database.
You can make loops run faster if you use āstatesā as much as possible, rather than reading or writing values to the database.
A āfaster loopā will not help you. You need faster operations within the loop.
Robert, thank you for the explication.
Let me try to use your solution again (I did try before responding to you first time: I looped the creation of 100 records where only one field for modified on the way, this took about 5 minutes before I could see 100 records createde).
I shall try to compare looping with what I have at the moment and report back.
One more question, do you reckon having a script ādo every xx secondsā on all the time somehow affect performance? Even if the loop isnāt actually looping?
It will always be looping if it is on.
You set a condition on the ādo every x secondsā to turn it on and off.
While the condition is āoffā, and the loop is not running, the loop itself is not affecting performance.
(though the condition itself which turns the loop āonā and āoffā will affect performance in a very very very minute way, and I wonāt explain that because it will probably be confusing as it involves discussing Bubbleās underlying code)
This is how I would suggest to implement this. Simple and powerfullā¦
A Workflow element holding the following entries
So you could have a workflow for example:
Step 3: add 1 to myElement State myValue (myValue = 1)
Step 4: do search and replace some string
Step 5: Do while myElement State myValue is < 10 go to step 3
Step 3: add 1 to myElement State myValue (myValue = 2)
Step 4: do search and replace some string
Step 5: Do while myElement State myValue is < 3 go to step 3
Step 3: add 1 to myElement State myValue (myValue = 3)
Step 4: do search and replace some string
Step 5: Do while myElement State myValue is < 3 go to step 3 (condition = false)
Step 6: Continue hereā¦
btw: I saw no-code authoring in the early 90s that did this⦠but coders seem ignore these, likely made accessible to othersā¦
need this now⦠lol
wait a minute⦠you can do this with a DO WHEN always
then incrementing a state value until the condition is met⦠just make sure donāt go into an infinite loop
I am going to try it will get backā¦
Hi mente12,
Weāre you able to do this?
I have just solved a similar issue using the List Shifter plugin, if thatās any help. It allows for lightweight (client-side?) iteration, which allowed me to view a database and simply iterate across a returned field to perform a per-user action.