List Shifter: Reverse, Rotate, Swap and ITERATE (Loop) Over Bubble Lists | Now Part of Floppy

Would you mind to tell me if this plugin does dynamic grouping?

How to create sorting by count of matches?

Hey everyone! I have list of user… Each user has the list of interests. I want to display to RG the of users who has at least one match and sort it by count of matches. Finding users with matches is done (I used the intersect … :count) , but I can’t figure out how to sort it, please help me!

Thanks!

This is a common problem in bubble that there are easy-ish code solutions for but that I’ve not published an explicit plugin for.

But List Shifter can help you with this, if you want to get down in it. See:

Thank you. I tried, but I really can’t understand how to do that for my case. Could you describe it a little bit, please?

Loom video)
There’s explanation of my case.

@keith Hi, i’ve come across a real head-scratcher on my app:

List shifter is iterating over a list, as per usual, but for some reason on this particular page, it’s stopping at the second item, not iterating over the entire list. Have you seen this happen before? what can i do?

Here’s my workflow:

I’ve verified the list has more than 2 items, and that the iterate event is getting triggered… but it just updates the index on items 1 & 2, but not the remaining items in the list :confused:

Well, what’s going on in the console?

Not seeing any errors for listShifter… could the lottie plugin errors be affecting it?

Well, yes.

okay, thanks, i’ll remove it tomorrow and check it out :slight_smile:

I have removed the plugin from the page, my console doesn’t show that error anymore, just it’s still not working, and I can’t seem to find the option in list shifter that prints the logs to console… is that a setting somewhere i’m missing? - Coulda swore that was a feature at one point :thinking:

My console now:

Are you sure you’re not trying to fire Begin Iterate before List Shifter is fully initialized?

fairly certain, even added a pause in my workflow:

FYI i have quite a few other listshifters on this page, all of which work great… its weird. Think i’m gonna try deleting this one and using another one

Okay Update! I’ve tried replacing and deleting and rebuilding the workflows, no effect.

But i just found something very interesting: The other listshifter i thought was working properly, apparently it is… up to two list items :man_facepalming:
Furthermore, it seems both listshifters aren’t ā€œseeingā€ anymore items to work with because they even fire the ā€œwhen listshifter iteration is completedā€ action successfully after the 2 items, even though i’ve confirmed there’s more than just 2 items in the list they’re pointing too… This is weirdd, i’m at a brick wall here :confused:

Oh and also, it must be fully initialized before i fire it, since it’s running through part of the list? wouldn’t it just flat-out not work if it didn’t finish initializing?

Not necessarily, because Bubble. But you could rule that out by examining the Initialized output in your workflow (drop Debug Buddy in there and write The List Shifter in Question’s Initialized to the console). Not being able to see your project I can’t really offer anything but spitballing. Obviously, List Shifter’s iterate function works in general, so… :man_shrugging:

Debug Buddy! that’s what i was trying to remember lol :slight_smile:

Also i got things working again, with the exception of the fact that my data isn’t loading into my custom state before firing the initialization… tried adding a ā€œpauseā€ but it doesn’t seem to affect it :confused: Any ideas? My Workflow:

P.S. I’ll be happy to get you access if you’re interested in looking into it that deeply :heavy_check_mark:

If you’re having trouble with sequencing/asynchronous execution (you say that the BEGIN step is firing before data is actually present in the custom state) don’t use a custom state. Just use a List Shifter instead. Use the SET Custom List action with the ā€œtrigger eventā€ and ā€œpublishā€ options on. You’ll get notified by that event when the Custom List has been updated. Do your BEGIN Iterate action on that trigger.

(You might also find passive ways of doing this with a List Shifter element’s List to Shift expression. Whenever the value of the expression changes, List Shifter will throw the Initialized/Updated event. But note that there’s not an Action to change List to Shift. That’s partly why I introduced Custom List.)

Nice plugin! I’m using it as a paginator and I’m not sure whether I’m doing something wrong. My repeating group for the items to be displayed on the page is set to use the Shifted List as its data source. It works fine but I’m unable to properly handle the the following scenario.

Context
I want to display 3 items per page
A checkbox [FILTER1] allows me to only display items where field [VISIBLE] is true
The original list takes checkbox [FILTER1] as a constraint to its data source.

Starting situation:
[FILTER1] is unchecked (I want to see all items)
Page 1:

  • Item 1 ([VISIBLE]=false)
  • Item 2 ([VISIBLE]=false)
  • Item 3 ([VISIBLE]=false)

Page 2:

  • Item 4 ([VISIBLE]=false)
  • Item 5 ([VISIBLE]=true)
  • Item 6 ([VISIBLE]=false)

Expected result
When I toggle [FILTER1] to true (I only want to see items that have [visible] = true), I expect to see:
Page 1:

  • Item 5 ([VISIBLE]=true)

Problem
Instead, I see:

Page 1: empty
Page 2:

  • Item 5 ([VISIBLE]=true)

=> I have to go to page 2 in order to see the item, although it should have been displayed directly on page 1.

Is there anything I can do to fix?

Thanks and keep up the good work!

Shifted List us your paginated items. The only things present at that output are the items that belong in that page. You’re trying to filter your entire list before displaying it paginated. This cannot be done the way you’re trying to do it.

Put another List Shifter upstream with your full list. Put some sort of filtering mechanism after it. Feed the filtered results into another List Shifter in pagination mode. Then you’ll have paginated, filtered results.

That’s what you want to do.

List Shifter isn’t magic, it just gives you access to a bunch of stuff that Bubble forgot to include.

1 Like