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

tenor-257889221

2 Likes

It works!
CleanShot 2022-01-23 at 08.56.52

1 Like

Glad to hear it, @rico.trevisan! And, yeah, if you’re rearranging content blocks, I can see why this would be very useful to have this behavior. Nice use case.

I still owe you and the community a video tutorial on using List Shifter. This might be one piece.

3 Likes

I notice that List Shifter now has more than 7200 installs. That’s pretty wild. Especially given that the whole goal of List Shifter was to encourage Bubble to finish their half-assed implementation of an array-oriented language. (Something they’ve made next-to-zero progress against.)

But, cool, I guess?

5 Likes

@keith Just published an app that wouldn’t have been even close to possible without the ListShifter.

I just counted, and I have 138 List Shifters that are the backbone of: news.takeside.io

This plugin is an absolute beast. Congrats on all the installs and thank you for the priceless contribution to bubble.

1 Like

We love to see it, @ben29! That’s a good looking site, too! I appreciate the props!

Hey @keith,

In a list of image from a repeatinggroup fixed cell,

I want to swap the original image that has been edited/cropped so when the button “Done” in Croppie is pressed, I deleted the previous image and try to run Shift item down whitin this workflow like this:

-Item number: repeatinggroup image item list’s page number

-Positions: repeatinggroup image item list’s list of images:count - repeatinggroup image item list’s page number

-Move items up: yes

But nothing happens.

Do I miss something because checking this thread I’ve seen this post of yours which has similarities with what I’m facing.

OK so those numbers are changing when the workflow operates… Will figure this out.

@Keith Hey I am trying to make a music app and I think this app can help me make playlist and achieve continuous play with the click of button! I have pretty much everything else figured out with the app except for playlist, which would also albums!

I would like for the user to be able to click on a playlist that either we made or they make them self and it be displayed in a repeating group. Then with the right workflow and your plugin it will be able to PROCESS each cell, play the song, when the song is done playing it will then fire the next song on the list and start playing in the player.

I would love to know if I can achieve this with your plugin, I’m fairly new to bubble but I pick up concepts quickly so I’m going to continue to try to make it happen on my own but if you have any guidance I would really appreciate it and donate to the plugin generously.

Thanks,
Syke

:point_up: “Page number”? What’s that?

Alright… I have a list of pictures similar to Facebook marketplace that I’d like to edit in case but when deleting the original bubble adds the new one in the end of the list. I’d like to swap the one I delete let’s say position 1 in the list with the last one. So I use the page number as reference with your plugin.

Not the correct way to do it?

Edit: either move up/down, or swap using numbers doesn’t work.

Am I missing something? This plugin ables you to move the position of items in a type of content within the database right?

Well, it sounds like you’re trying to get the index of some item’s position in List Shifter, correct?

But then, you’re displaying the items held in a List Shifter in a Repeating Group with some fixed number of rows. Correct? Further, it sounds like the number of rows you are displaying in the RG is 1.

And so, you are assuming that the RG’s “page” is equivalent that item’s index in list Shifter. (This would be a correct surmise.)

BUT THEN YOU TELL ME THIS:

“ I want to swap the original image that has been edited/cropped so when the button “Done” in Croppie is pressed, I deleted the previous image and try to run Shift item down whitin this workflow like this”

That’s not what “Swap Items” does. Swap Items says, change the positions of (for example) Item 1 and Item 4 in List Shifter’s Shifted List.

It doesn’t replace some property value of Item 1 with the same property value of Item 4.

Further, if List Shifter is holding a List of images and you’re feeding List Shifter “some-list-of-images” (in the main interface) and then you delete one of those images, LIST SHIFTER RESETS. It reads the new value of the list.

So, maybe that’s what’s going on?

Anyway, it’s easy to debug this. Just write original list and shifted list to a text element and watch what’s going on.

Again, not seeing your app, I don’t know what’s going on, but perhaps the above will help you.

So I’ll dig in this plugin and learn.

I just set up a swap button and it’s not even working.

My listshifterkw element is of type image and its list gets all the images.

On click I swap or shift item up and no responses.

:man_shrugging:

Okay I’ve watched the first tuto.

So my question will be: “Is it possible to rotate a list of pictures inside an item from a type of data?”

Rotate +1 would do the trick

I saw that in Product type you rotate a list of items (products) not a list (of pictures) within a product.

Edit: OK I get what this plugin does. You talked about custom state… I can rotate items in the shifted list and it’s not what I’m looking for. Must find a set up with bubble. Trying to understand how could I do.

It looked simple… Just editing a picture and replacing the original by the edited one. But bubble adds new items in a raw.

Maybe this thread will help me:

Hi @keith,

I wonder if you can advise me on this use case.

I am making a form builder, I can create questions but I also want to be able to change the order in which the questions display. I can easily do this with the SHIFT operator which will help to edit the view of the repeatinggroup.

However, when it comes to editing this form again or for a user submitting the form - the order of questions won’t have updated and will simply be in the original format.

I wonder how I can achieve my goal with List Shifter?

1 Like

Let’s say you have a Form object (a Thing, a custom data type) and on that Form you have a list of Form Elements. And now you’re loading that list of Form Elements into List Shifter and moving those Form Elements around.

The original list of Form Elements (in their original order) is at List Shifter’s Original List output and the reordered list of Form Elements (in their new order) is at List Shifter’s Shifted List output.

Well, when you’re done moving those Form Elements around you can just take that Shifted List of Form Elements and put them back on the Form in question. (You would do this in response to the user taking some action like clicking a “Save Changes” button or something.)

You do this using the Bubble action “Data (Things) > Make changes to a thing…”. In that dialog, specify the Form whose Form Elements list you want to set. Then specify the field to change as Form Elements. When the type of the field is a list, you will see options including “set list” (which says, “replace the current list with some new list”) and then you select your List Shifter’s Shifted List as the new Form Elements list you want to write onto your Form object.

Hi Keith, thanks for the reply. I should have mentioned that my form builder (is probably a bodge job) essentially has the user create a “response” for each field. So say you have a form with 5 entries, you choose to submit a new entry for this form it’ll create an “entry” with 5 “responses” where the entry values are stored.

My problem is that when creating the “responses” I run a workflow on a list to create all of the needed responses per field. In turn, this ends up not running “in sequence” meaning that a list of 1,2,3,4 becomes 4,2,3,1. This wouldn’t be an issue if I could figure out how to sort these items back into the correct order for display.

Obviously, the perfect thing would be to have the workflow create the items “in order” and reduce the need for additional sorting at submission.

@cliffwoodjames you can always create them, in order, using a recursive workflow that creates your Form object and then creates and attaches the Things you need to create in the same order that you supplied them to the workflow. To understand how this could be done (and also why just doing things “the Bubble way” in the page as you go might be a better route, anyway), see my video about shopping carts, that’s included in the first post about my List Popper plugin.

Since people seem to want to do this sort of thing a lot (even though it’s not necessarily advantageous) I’m creating a new commercial plugin that (amongst many other things) makes this easier. (But it’s nothing you can’t do with List Shifter and List Popper, it’s just a little more optimized for this specific use case.)

Anyway, go watch the video here: List Popper and Friends: New SSA Plugin for Your Backend Workflow (API Workflow) Needs

1 Like

Thanks for the ping @keith !

1 Like

Also, not exactly a “bug”, but I realized that Bubble does some pretty wild things with sanitization of different types of Lists (which vary depending on the type of items in the list) which probably caused consternation with the List Popper and Friends plugins from time to time.

A fix and an interesting video about this incoming soon.

@keith I sent you a message reply a few days ago hope you didnt miss it