Loop through custom state (list)

Hi there,

Is the following possible with Bubble.

I have a repeating group with checkboxes. Each time I check an item it gets added to a custom state list. Then there is button to process all selected records that are in the custom state.

Use case: I have a repeating group with orders and I want to push the selected orders to an external system using a POST API.

How should I iterate or loop through the items in the custom state list

Thanks!

API workflow on a list

i m looking for the same thing :smiley:

check my post. There is a solution there

Check out the Toolit kit plug-in. There is an element called for each that will help you achieve that.

Msg back if you need help setting it up

1 Like

Thanks all, I will try some stuff out! I will report back the results

Hi @AliFarahat,

I could sure use that help. I have the toolbox plugin but can’t find what you mentioned.

Thanks,
George

Hey @gnelson

Check out the example here for each

2 Likes

LOL. I misread the name of the plugin as another one. I see this one is yours. It’s actually what I was looking for. Thanks for your help!

George

While the forEach method will work in some contexts, note that if you’re doing something like firing a workflow only when the previous iteration’s workflow is truly complete, you can use List Shifter’s iterate function.

(The issue being that the “delay” parameter will never be right for all devices in all situations. It will be too short for some devices and longer-than-need-be for others.)

This being said, Bubble in-page workflows themselves are either poorly coded, bugged, or intentionally slowed (which wouldn’t make sense, but is a possibility — is it because of logging? Why do we even need logging for workflows that don’t touch the database?) and even a trivial (or even EMPTY) Bubble workflow takes a measurable time to complete (“why?” we wonder - I guess it’s because logging? :man_shrugging:).

As a result, iterating over workflows takes longer than it “should”.

If what you want to do is purely computational and in the page, you can use List Shifter’s PROCESS List action which operates at essentially native JavaScript speeds.

At least there are iteration options available. When I started with Bubble there were none/zero/zip.

(Though it’s literally, actually inexplicable that a native/vanilla solution doesn’t exist. It would be excusable if Bubble were truly an array-oriented environment, but it’s not as it’s missing some basic features there.)

2 Likes

Hi @AliFarahat,

Is your plugin still available for download, as I can’t find it in Bubbles’ plugin search?

Thanks,

JĂ©rĂ´me

Yes it is. It’s called ultimate toolkit the element is called for each

hi @AliFarahat ,

I have an event starting the ForEach. I have a second event executing this ForEach.
But after the Start ForEach it never goes inside the executing event. I just don’t get why.
Any hints?
The ForEach is just a custom state list. The start is triggerend when pressing a button. The executing event is just hiding a panel (to simplify the test).