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

Just make sure 1.4.0 is selected in the plugin tab? If Bubble somehow actively upgraded you, that should restore things to normal.

That was the first thing I checked. I thought maybe I had accidentally upgraded but it was still set to 1.4.0.

That shouldn’t go live anyway until I deploy would it?

I have a list of dates. I’m trying to use list processor to subtract a few hours (a dynamic amount stored as a custom state) from each of them. It appears the syntax does not allow it.

it seems the only place I can subtract hours from a date is when I’m writing to the database, or defining a text field. Any suggestions?

Hey @jeffmccutcheon, is it one value held in a custom state? Or is the custom state a list of times to subtract? (The latter is harder / may not be possible.)

But if it’s just one value…

You can actually do time math like this in the List Processor, but you have to do it in a very basic JavaScripty way. It goes like this:

  1. You have a number of hours (let’s call it H) you need to subtract from a date. Convert hours into milliseconds by multiplying H * 3600000

  2. You have dates in your list you are trying to process. You can turn the list item into Unix milliseconds by doing the “getTime” operator.

  3. Take result of 2 and subtract result of 1

  4. Do operator “new date” on the result of 3.

  5. Push result of 4 onto the Processed List.

Now you have a list of dates that are all H hours less than the source list!

I’m pretty sure this works in a List Shifter though I’m just writing from memory at the moment, but your application is why I put those operators in.

I can test and do a loom video in a bit…

Thank you for the detailed reply! I think this will be a life saver. It is just a single value I need to subtract.

However it threw an error upon first attempt. (attaching screenshot) Let me know if you want to take a look as collaborator.

Upon inspection it seems that when I set my processed list output to “date” it won’t let me enter the " Convert hours into milliseconds by multiplying H * 3600000" . But if I change the processed list output to a number it does allow me to do it.

I tried to output my processed list as a number (skipping the new date option in step 4 above) and then run a 2nd list processor on those numbers and perform the “new date” operation on them, but it threw the same error.

Hey @jeffmccutcheon,

I can do a video about this later, but here’s how:

(that’s edit mode)

Here’s run mode:

Inspect the List Shifter element in the upper right of the page (over the hero graphic). In edit mode, scroll to the bottom of the List Shifter element’s edit dialog… note how I used the Numeric Constant to inject the “hours” float. And then, on from there, it’s smooth sailing…

Cheers,
Keith

2 Likes

Thank you! That did it. Works like a charm.

I do have one issue that seems a problem with bubble in general: Running later steps in the workflow before earlier ones are complete.

Right now, when I click a date on the date picker, it runs a bunch of calculations (to populate my list shifter) that take about a half second. Thus, my process list shifter step tries to run before the list is populated (and throws an error). I saw what you did in your demo (fill the “only when” field with “if this list is not empty” but then it doesn’t run at all. I had to make a “process list” button just to see if it was working (it was)

Is there a way to prevent it from running until earlier steps are complete (but assure it doesn’t get skipped) My current idea is to actually put a time pause in the workflow but doesn’t seem right.

I should note it was even running too early even after I divided the workflow and put the “process list” step into a custom event that ran at the end of the my first workflow.

HI @jeffmccutcheon: Note that List Shifter fires an event called “Initialized/Updated” whenever its fields change and and it is ready to accept Actions. You can trigger things off of that event, like:

So that’s an active form of detecting readiness.

Additionally, it publishes a state called Initialized which goes to true (“yes”) at the same time, so you can passively check for readiness. You might use it like this:

(Note that the expression “List Shifter A’s Initialized” is the same thing as “List Shifter A’s Initialized is yes”.) If you want to know if List Shifter A is not initialized, that’s “List Shifter A’s Initialized is no” (in Bubble, “some_boolean_expresssion is no” is the Boolean “not” or negation operator).

It’s worth noting that my Calendar Grid Pro plugin has similar features for reporting and detecting Initialization.

(It could be argued that these plugins should report to the debugger or console if you try to send Actions to them before they are ready and that’s something I might add in future. One thing that’s very odd about the Bubble plugin builder is every Action, Exposed State and Event has a field for documentation, but that documentation does not “bubble up” to the editor, so there’s no “built in” way to learn about what these things do, except in the case of Actions where there’s a UI. But you can inspect those in open source plugins in the plugin editor.

Here’s what that looks like for List Shifter:

)

@keith I realize this is off-topic. I have received continual monthly charges on my credit card for your Grupz calendar widget after my cancellation of the subscription. I have made multiple attempts to contact you via email with no response. I have made attempts via the phone listed as well as other possible contacts I have found via google search. I’m not understanding the lack of response and failure to refund and stop the continual charges? It’s only $13/month but even so, it’s been very disappointing that your statements regarding “cancel at any time” have not been honored, and at the very least you couldn’t take the time to send a simple response as to why after my many attempts to communicate with you. Most recent receipt # 2430-9055

Hey @rachael3boys: I see you as a customer in stripe who with an active subscription. I have now canceled that subscription (in Stripe, which will end it permanently). Your Stripe customer email was azsecretsvr@gmail.com, but I do not see you as a customer in GRUPZ with that email.

I have been debugging a very strange bug related to subscription cancellation that may have affected you and – if you can tell me approximately when you wanted to unsubscribe – I’ll be happy to refund the affected periods.

I’ve not really been able to track down the source of this problem – did you perhaps try to unsubscribe by deleting your widgets? That’s the only thing I can think of that might have caused this issue. I really appreciate any info you can provide!

Best Regards,
Keith

Hi Keith, Thanks for the response. I cancelled the subscription through stripe on my dashboard. My dashboard has shown confirmed ‘inactive’ subscription since the cancellation. I sent another email to the admin@grupz with more details and screenshots. Hope we can continue the conversation there. I only used the old email to make an account here as a last ditch attempt at getting in contact with you. Thanks

Thanks Keith, that looks like exactly what I need, however i couldn’t get it to work. I am likely just bleary eyed – I set up a “when listshifter a Initialized” trigger, however it triggered right when my page loaded.

The pause solution is working well for now - it still feels real time .

Pssst… There’s a new version of List Shifter available. It’s a massive update, but (as usual) the features take some explaining.

If you’re new to List Shifter, just go get it (all of the old functionality is still there, with a bunch of new shiny).

If you use List Shifter in production projects note that the new version (1.7) is a BREAKING CHANGE that will unfortunately require you to replace your old list shifter elements and actions with the new one. So, just be aware of that… Play with the new List Shifter in new projects and schedule time to migrate to the new one for any production apps.

(Once again, the issue with substantial List Shifter updates causing you to have to replace elements has to do with Bubble’s plugin builder. Sigh. Sorry.)

Anyway, videos to come exploring some of the awesome new features…

And there’s a non breaking (from 1.7) 1.7.1 that adds a SORT List action. This sorts the Original List and publishes it as Shifted List.

It allows you to sort the list using an external list, in addition to the fields that are already a part of the list object items. Also, alphabetical (Text) sorting uses LocaleCompare for better international results than you might get from Bubble. Numeric, Text and Date sort modes are available.

1 Like

Hi @keith
Thanks for this plugin!
I was wondering if you have some info on how to use the Get index feature?
Actually, the info about Original position (and shifted too) stay empty.

It’s possible that’s bugged in the current version. I’m working on yet another point update and will check…

2 Likes

@Jici, it works for me. It’s very simple, you just execute the action and the indices appear at the labeled outputs. In this example, List Shifter KW B holds a list of numbers 1-1000. Shifted list has been reversed. So, let’s find the index of the value “45”:

Page setup:

Click the button in run mode to see answer:
image

Though I do see that the docs on this aren’t incredibly clear.

Hum ok. I think I don’t use it correctly.
What I’m trying todo is search an item in a list of item.
So I provide the list in the element,
And search a specific item in the list (Search for…where unique id = Currrent user id: first item) (just an example)