Error in for each loop


#1

Hi,

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:


and the error in the logs:


#2

hi @Siene

Have you initialized the Dictionary?

Thanks
Ashwin S


#3

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.


#4

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


#5

hi

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.