Error in for each loop


I’m stuck on an error in my workflow, I’ve been changing things now for 5 hours, but nothing worked, the error keep poppin up, and because of the error the foreach loop only processes the first item (I checked if the dictionary had multiple items and that was okay, so that was not the problem). so I’m getting really desperate, does somebody know what the error means??

The error that I get:error_foreach
and the error in the logs:

hi @Siene

Have you initialized the Dictionary?

Ashwin S

1 Like

Hi Siene,
According to the error message check the ancestor.
Check whether the dictionary is assigned properly or not.
Dictionary is taking proper values or not.
Use write line to check till which part it is working fine.
If you can upload .xaml file, then I can help you more on the issue.

1 Like

once you delete the each row and give as new each row
change the outval also

1 Like


I did had initialized my dictionary.
I found out what the issue was, I created two dictionaries, filled one with proper values and one I assigned to the other one (dictionary2 = dictionary1) so that the second had the same values as the first. then while looping through dictionary1 I could change some values of dictionary2, but because of I made the dictionary 2 assigned to dictionary one I could not change the values of dictionary2 while looping through one. I placed than the values of dictionary1 into dictionary2 with a for each loop and an add to dictionary activity and this solved my issue.