I had to stop and take a break to re-evaluate my beliefs the moment the devil possessed you.
Iād blame Loom for this, @jonl, but itās more likely an issue with Chrome and/or the audio interface Iām using. Seems like sometimes when I pause, it causes my audio interface to switch from 44.1kHz to 48kHz. And of course, this happens without me being able to tell. Kind of annoyingā¦ But funny here.
Anyway, I hope this gets you going with Iteration with List Shifter! Let me know if you run into any other problems!
Next time you can start the video:
Hey hey itās Keith from hellz
I would assume List Shifter Pro will be a plugin we can get in the Marketplace?
Oh, ha! Iām so used to writing āCalendar Grid Proā that I just compulsively added Pro hereā¦
These features are in āList Shifter Karma-Wareā plug-in thatās freely downloadable. It doesnāt enforce a subscription, but ā if you use it and find value in it ā thereās a contributions page at:
ā¦ where you can pay what you want, or pick from several options.
Hey Keith, thank you for the tutorials! Theyāre quite useful, especially when used in conjunction with other client side plugins. The feature Iām more interested in is the iteration, but all of them seem interesting now that I went through the tutorials.
That said, I still canāt make iteration work without using āshifted listā on the field List to iterate over
, it says ālist is emptyā. Can it be used with the āoriginal listā option?
I think so, else you would not add the option. Then, how? And yes, āshifted listā works as expected, I change nothing when using the āoriginal listā option.
My setup is this one:
Editor - https://bubble.io/page?type=page&name=testing_list_shifter&id=pdf-conjurer-testbed&tab=tabs-1
Run mode - https://pdf-conjurer-testbed.bubbleapps.io/version-test/testing_list_shifter?debug_mode=true
All it does is increment the number by one. Just a simple learning page.
On another thought, this plugin is quite prometheanā¦ I mean, the gods here forbade us from client side looping and you just brought it back. I think youāll end up alive and unchained because your implementation is clean, tidier (over a well defined list, instead of just linking two client side workflows) and non official, which makes it not a Bubble teamās problem.
Anyway, any chance for us to get an āiteration finishedā event?
So we can freeze ourselves in a never ending loop by triggering the same ābegin iterationā again. Just kidding, I promise Iāll use it in a good way
Hey, @vini_brito. Itās possible youāve discovered a bug with List Shifter. Original List should work as an iteration source, but maybe Iāve made a boo boo. In the meantime, just use a List Shifter without any modifications and select Shifted List as the source. Thatās the same thing.
However, I am using List Shifter in production with my Calendar Grid Pro plugin (well, my private version which is where I test new features) with no issues. (Though note that I use Shifted List always as the iteration source.) You can see a sample here ā check out my new GRUPZ Booking Widgetā¦ it rocks out loud: https://grupz.com/vacation-rental-booking
When you select some dates in the booking widget, the calculation that happens is CG Pro iteration (to get the rate quote), followed by List Shifter iteration (to calculate fees). Works a treat.
On your other questions: Yes, I do see a use for an āIteration Completeā event and Iāll add that in a future update. I added that to CG Pro (private version) as it turns out thatās fairly useful.
Best regards,
Keith
Great! Thank you for taking the time to respond to that
Yes, it totally works no problem whatsoever by just using the default, great in its glory.
And again thank you for the plugin!
And BTW, Iāll take a look at List Shifter later today. Adding iteration complete event is easy and if iterate over original list is bugged, thatās a simple fix as well.
I spent the weekend doing MASSIVE updates to my grupz.com site (which generated a ton of new features for Calendar Grid Pro).
So, there is already an iteration complete event. Update to the latest version, eh?
However, there is a bug in the iterate action when using original list. Iāll fix it.
OK, List Shifter version 1.3.0 is now available. This version fixes the bug that kept iteration over the Original List from working properly.
Please upgrade!
(Aside: Stupidest bug ever ā I was simply setting the name of the list variable incorrectly when āOriginal Listā was selected as the list source. Apparently, I had not tested that option! Dāoh! Apologies, my peeps.)
Shout out to @vini_brito for reporting that it never worked correctly!
High five!
Thank you for it! All is fine now.
This makes life much easier with client side plugins.
This plugin
New version coming shortly, too. Added a feature to just make a list of numbers (with start at and increment values), so you can use it purely as an iterator or just to make a list of numbers if you so desire/need.
Just published List Shifter version 1.4. This adds an option to construct a numeric list rather than having to use the āOriginal Listā field. This is useful for those who want to use List Shifter purely as an iterator.
Additionally, thereās a new GET INDEX Action that allows you to find the position of an item in the lists. You can optionally set the selected item to that item in one fell swoop.
Useful stuff!
As a reminder, if you dig List Shifter and get value from it, remember that it is Karma Wareā¦ You can keep your Karma clear by contributing here:
Iāve been wondering lately if one could construct a page that acts as a pseudo-API of sorts to host and perform perform these iterative actions via the page and then scrape the results. This would allow for server-side processing on data that is simply not possible right now now without using an insufferably slow recursive API workflow.
The issue Iāve found, is that the bubble page rendering technique seems to resist scraping by even the most robust scraping toolsāat least in a default configuration.
Given how this tool is progressing towards a āpureā data processor, Iām wondering if anyone has given this serious thought?
Hey @jon2, these are interesting thoughts.
What youāre getting at is a concept thatās more generally called FaaS (functions as a service). Iād dissuade you from trying to make FaaS things in Bubble. Thatās just not what itās for. (Youād be better off spending your time learning JavaScript ā which is actually a joy to work with ā and just doing the iterative things you need in your Bubble page (via a plugin or via the Run JavaScript and/or Expression plugins from Toolbox).
The above being said: I have thought about building a little āsequencerā interface into List Shifter (or something like it) to get around the problems inherent in calling Bubble workflows in order to iterate.
This is a very deep problem and so Iām going to apologize for not posting a very deep answer. However, you can do the following test in the latest version of List Shifter:
- create a 100,000 (one hundred thousand) length numeric list with list shifter.
- Create an iteration workflow. JUST do that. Do not put any actions in it.
- Fire that off with āBegin Iterateā
Even though there are NO ACTIONS in that workflow, youāll see that the blue bar of death appears. (Why?)
Thereās simply an appreciable amount of time that transpires between iterations. This is fine for 0-100 iterations, but it starts to become annoying for orders of magnitude greater than that. (And, really annoyance sets in at about iteration 40.)
What is Bubble doing? We donāt (cannot) know, unfortunately. We do know that itās bothering to draw the wait state bar, but thatās about it. (Why does it bother? We do not know.)
So I have thought about giving you a āsequencerā of steps to execute on each iteration (bypassing the sending of an Event back up into Bubble).
But then, Iām essentially bypassing Bubble and writing my own no code platform, with its own API (programming interface). So, Iām not sure that I care, if you get my drift.
And here was I hoping I could use the plugin to iterate my over my over 100k list and make an api call in each step.
I tried it yesterday and it actually froze the browser.
I knew it was a bad idea but just wanted to push it to its limit to see.
But for a small list of about 10 to 20 the iterator really works amazingly.
I guess bubble didnāt implement this know people might want to run it on huge lists.
I have a basic working knowledge of JS. The issue Iām encountering is querying the bubble Db server-side during an API workflow. Running more complex iterative queries on the db requires launching a recursive workflow. For example, right now on my page I use a repeating group setup as a calendar to calculate my projected inventory on hand for the next month.
This works fine and is fast (<5 seconds) to load the repeating group. The repeating group is able to take my dynamic query (which is somewhat complex given my specific db architecture) and loops through it quickly for all visible days. I can visually scan through and see what the inventory is for each day.
The problem
There is simply no built-in equivalent method Iāve found to do the above server side without having to launch a separate workflow for each day to calculate the inventory. (365 workflows per year). My end-goal is to run my inventory counting query on a schedule (say twice a day) and to setup email alerts when a low inventory number is found on a given day. On the page, this takes seconds and can be done in a standard bubble dynamic expressing. Doing it as a recursive workflow takes 10 minutes and uses nearly all of my server capacity during that time.
Iām wondering if there is a way to get the computational power of a page repeating group while server side without having to launch 365 API workflows and the large overhead that requires.
HEY @seanhoots: Funny you should mention this as I was thinking about doing a video on this. There is a client-dependent limit to how many items List Shifter can deal with.
This limit is orders of magnitude larger than for repeating groups (which of course can create many many DOM elements and hence can get very heavy on the client). RGs are OK to about 100 items, but can become very performance limiting at this level.
Depending on the client, LS can handle about 100,000 item lists before the browser falls over. On my very well specced development machine (with 32 Gigs RAM) Windows Chrome will handle up to 100,000 items and can operate on them without issue.
Again, oneās mileage will vary, depending on client-side (browser) resourcesā¦
In the case of List Shifter, what happens is that the call stack limit can get exceeded. And (while Iāve not played around with this deeply yet) this may be because I coded List Shifter entirely with array type operations rather than literal loops. I avoid loops in favor of more modern iterable expressionsā¦
But it turns out that some of these place undue restrictions on the client.
Working on some enhancements that may make List Shifter essentially unlimited in terms of what it can doā¦