LOOPER v2 not working correctly when started from step enter trigger

I just imported LOOPER v2 https://library.tulip.co/apps/looper to my sandbox instance, and created simple test App which just iterate through “a”, “b”, and “c”.
image

I am expecting to see “0:a”, “1:b”, “2:c” when the loop runs.
I do see that when I start the loop by pressing the button.
However, I see “0:a”, “1:a”, “2:c” when I start the loop from step enter trigger (by setting the Begin loop flag to Yes).

Why is it not working as expected?

I guess this fix might help :wink:

if not, some screenshots of the setup would help.

1 Like

Thank you! It fixed the problem.
Please release LOOPER v3 with this fix.

1 Like

Great timing for this question, we are in the process of releasing an updated looper widget with this fix! I will follow up here once we do. Should be coming shortly :slight_smile:

1 Like

I now have this issue about custom widget which is also related to LOOPER v2.1.

Could Tulip please check whether this is expected behavior?

@Beth @thorsten.langner
Please try this simple test App starting the looper v2.1 from the step enter trigger.
app.json (13.9 KB)
I wanted to see “A”, “B”, “C” appear, but I see “{}” instead of “A”.

I am guessing that this happens because SetValue is not having immediate effect.

Thank you for pointing out the issue with the behavior of the Looper widget — you’re absolutely right, it was not functioning as expected. We’ve identified and fixed the problem, and the updated version will be available in the Tulip Library starting this Thursday, June 19.

In the meantime, we recommend checking out the following updated guide on unit testing the Looper widget, which may help you validate its behavior in your environment:
:link: Looper Unit Test

We really appreciate your feedback — insights like this help us improve the reliability and usefulness of widgets for the entire community.

2 Likes

Thank you!
This Thursday …June right? Perfect!

Please could you comment on this post too?

Where can I download/install the new Looper v3 ?
I went through Tulip library and knowledge base, but I couldn’t find the available link.

@Mihaly
I was able to download Looper v3 from the library. I will check how it works.

On the other hand, I guess this link on the Knowledge Base need to be updated. Please check.

I guess you need to rewrite this yellow part to v3.

The link is now fixed. Thank you.

This seems to be now fixed. Thank you.

I tested Looper v3.
Now it is working as expected. I see “A”, “B”, “C” appear correctly.

I read through the difference between v2.1 and v3 code.
It seems like adding “+0” to the v2.1 code will solve the issue I oberved.

Thank you.

@Mihaly
I found a problem in LOOPER v3. Please run this simple test App.
app.json (14.9 KB)

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

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

As I explained in this post,

setValue("Iteration", 0);

does not work as a initializer.

I propose do something like

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

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

A While ago I posted this fix for looper v2

For me that works and I never had any issues…


find here:

Thank you for the comment.

Yes I know that. LOOPER v3 already have that implemented.

However, I still see this “B”->“B”->“C” issue.
This happens when “Iteration” was not zero when “Begin Loop” became true.
It happens because the initializer “setValue(“Iteration”, 0);” is having the effect asynchronously.

I’m sorry. I can’t test your application, because I can not import your json.

do you mind sharing screenshots of the trigger logic, leading to this behaviour?

I am sorry, I did not explain enough how to import that json file.
Could you please follow this procedure

  1. Create zip file with one single “app.json” in it.
  2. Rename the zip file to “looper_v3_test_counter_starting_from_1.zip”
  3. Import the zip file from the App folder

This is the screenshot.

Variables.

Props

“begin loop” trigger on step2 enter