Auto image slider using backend workflow + custom state?

Hey there!

I’m trying to create an automatic image slider that skips to the next image (from our database) every couple of seconds.

I have got close to a resolution but no cigar…

Current set up

• Data type called Clients, including the field we want to cycle through - client image.
• Group with client image in it, defaulting to item #1
• State on the group that is a number (defaults to 1)
• Workflow of on page load, PAUSE - set state of group to current state + 1 , PAUSE - set state of group to current state + 1 , PAUSE - set state of group to current state + 1 etc for six times (that’s the number of images we have), then the last state takes it back to 1.

The problem

This works, however, as soon as it gets to the end of the workflow, it stops. It doesn’t loop. I also have to manually put as many pauses and set states as there are images.

My thoughts

I feel like I have to use a backend workflow, which i’ve only so far used for bulk operations. I don’t know how - or if I even need to - run a workflow on a state which is on another page (our index page)… so i’m stuck!

Any help is massively appreciated.

(Oh, and I’m trying to not use a plugin, but I don’t know if that’s the key!)

I didn’t really understand the problem. I could do the following behavior easily. Check the demo. There are just two images in mine, it increases the current every second, and it goes to the beginning of the list after the limit with the modulo operator:

Here is the image:

The custom state is called Current (on the page):

And the workflow runs every second:

Here is the editor if you want to check details: Tests for Forum 11 | Bubble Editor

It sounds like you understood the problem perfectly, @hergin !

Thank you for this - I’m going to try it today :slight_smile:

Does anybody know if this would really max out the workload usage? Or does it only happen for the viewer on the page, rather than doing it every second of the day?

I think the only thing that might use WU every second is the search for: count which you can eliminate by putting it to a custom state on page load and check this custom state instead of the actual one.

this worked, thanks @hergin !

1 Like