Variable Loop Condition Execute failed: Encountered duplicate row ID "Iteration 1"

Hello,

I am doing my first experience with flow variables and loops.
I was able to build a loop based on the Table to Variable Loop Start node and the Variable Condition Loop End.
For some reason, I get the ERROR Variable Condition Loop End 4:1040 Execute failed: Encountered duplicate row ID “Iteration 1”.
Sometimes I get this Error after the Iteration 4, 11, 20 or any other iteration. When I am taking only 3 iterations, it runs through successfully sometimes. I cant find any pattern.
I can see that the looping works well and that all nodes run through successfully.
But the Variable Condition Loop End node does not.

Does someone have an idea what I am doing wrong? Is the setting of the Variables correctly attached?
Thank you very much for your assistance.


Hello @wantti , great to read that you are experimenting with loops and variables!
Would you mind sharing your workflow with us so that we can have a look?

That would be extremely useful for debugging. If you are concerned about sharing the data, just a mock table is enough, as long as the workflow runs (and fails :smile:).

Cheers,
Emilio

2 Likes

Hi,

Do you need a table row variable to a loop? maybe you can use a chunk to check line by line and use the loop variable condition to check the information is correct our not, to do it again…

On my example, i need to check as mencionated above, line by line, and if error, try again and again…

The chunk loop pick 1 row at all, the pass to generic loop to make a validation process.

I made a rest request, bring the status code information (200/400…) to a variable and check it with a variable condition loop end. If the value os Status is “200”, it pass, else is a error and need to be re-processed. Then, if ok, the chunk loop bring the second value to be check ands going on…

image

Here you need to select the “Status” field to bring the value to a variable.

image

Here i set Status as flow variable to check if it is “200”, the collect all information.

For the end loop, You can check to ignore empty tables and the possibility of some columns have missing values or “other types”… just to collect all information.

After all of it, you’ll have a checked process and information and can manipulate it after as you wish.

I Hope that it helps you.

Tks,

Denis

2 Likes

Hello Emilio,

thank you for your response. I have attached my workflow. I am hoping you get the point what I am trying to do.
Variable loop condition.knwf (130.2 KB)

Hi @wantti

Your wf doesn’t contain any data. That makes it difficult to check what is happening. Uncheck “Reset Workflow(s) Before Export”, to upload a wf with data (be sure there is no confidential or privacy related data in your wf).


gr, Hans

Thank you for advising me how to do it right.
Please find the corrected workflow.
Variable loop condition.knwf (1.5 MB)

2 Likes

Hi @wantti

I took a look at your wf, and I have no idea what caused the problem.
But I have some suggestions for improvement.

  • Replace the Variable Condition Loop End by a “normal” Loop End node.
  • Remove the red flow variable line between Table Row to Variable Loop Start and the Constant Value Column node. Your flow variables are already part of your workflow after the Table Row to Variable Loop Start
  • Remove the red flow variable line between the Constant Value Column and a Loop End node
  • In the Text Analyse Metanode there are quite some nodes with no function or a dead-end, you better remove them.

When I ran the wf Variable loop condition_v2.knwf (1.8 MB) , it works fine.
Hopes it works on your machine as well.

gr. Hans

2 Likes

Hello Hans,

thank you very much for helping me.
The workflow is working now. After changing the Loop End node it still gave me the same error. But after I have deleted all the unnecessary nodes in the component, the Loop is running properly.
Is this a general rule, that components run properly only when there is no unused node inside?

The general concept of looping and understanding which of the different loops to use is still confusing me.
I saw that there is a group loop existing. This is an even more elegant way.

Thank you once again.

2 Likes

Hello,

thank you very much for sharing your ideas and solutions.
It helped me to understand better the concept of looping, whereby I a still have my questions :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.