# LOOPER v2 not working correctly when started from step enter trigger

**URL:** <https://community.tulip.co/t/looper-v2-not-working-correctly-when-started-from-step-enter-trigger/14170>\
**Category:** Developer\
**Tags:** library, loop, custom-widgets, looper-widget\
**Created:** [March 18, 2025, 6:48am UTC](https://community.tulip.co/t/looper-v2-not-working-correctly-when-started-from-step-enter-trigger/14170 "2025-03-18T06:48:47Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![ta-aoki](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@ta-aoki](https://community.tulip.co/u/ta-aoki)\
**Post date:** [July 8, 2025, 5:21am UTC](https://community.tulip.co/t/looper-v2-not-working-correctly-when-started-from-step-enter-trigger/14170/16 "2025-07-08T05:21:50Z")

</div>

@Mihaly  
I found a problem in LOOPER v3. Please run this simple test App.  
[app.json](https://community.tulip.co/uploads/short-url/sIjG2Dpu8U1rH7j2N5K3YZKKI8t.json) (14.9 KB)

If you go to step2, I was expecting to see “A”, “B”, “C”, but I see “ **B** ”, “B”, “C”.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/1/103901155105f8e5dcd6d8bbb35981ea0169116d.png)

This happens if the “Iteration” prop is 1 before starting the loop.

As I explained in this post,

> [@SetValue does not have effect immediately?](https://community.tulip.co/t/setvalue-does-not-have-effect-immediately/14427/2):
>
> Because of this behavior, we cannot rely on this line 7 in LOOPER v2.1 to have the “Iteration” initialized to 0. We need make sure the prop “Iteration” is initialized to 0 in the app side before changing the “Begin Loop” prop to Yes.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/6/6e9838de27e692a97524f0fb1caa3eb17d4621ac.png)

```auto
setValue("Iteration", 0);

```

does not work as a initializer.

I propose do something like

```auto
if(0 != getValue("Iteration")){
   fireEvent("Error", "Iteration not zero");
   return;
}

```

here, so that the loop do not start if the Iteration is not zero.

---

_[View the full topic](https://community.tulip.co/t/looper-v2-not-working-correctly-when-started-from-step-enter-trigger/14170)._
