Variable item already exists exception


#1

Hi,

I am getting below error many times and I am not sure at which line the error is there as when I check there are no green ticks and red cross it just disappears when this error comes so not able to debug properly.

Variable item already exists
java.lang.IllegalArgumentException: Variable item already exists
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:93)
at com.workfusion.studio.rpa.recorder.model.playback.player.PlaybackStackFrame.addVariable(PlaybackStackFrame.java:53)
at com.workfusion.studio.rpa.recorder.model.playback.player.PlaybackStack.addVariable(PlaybackStack.java:82)
at com.workfusion.studio.rpa.recorder.model.playback.action.ForEachAction.execute(ForEachAction.java:98)
at com.workfusion.studio.rpa.recorder.model.playback.action.ForEachAction.execute(ForEachAction.java:23)
at com.workfusion.studio.rpa.recorder.model.playback.player.ActionPlayer.next(ActionPlayer.java:51)
at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:147)
at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.run(PlaybackLogic.java:108)
at java.lang.Thread.run(Thread.java:745)

does anyone have any idea for this issue?


#2

Hi,

I found where I am getting the error.

its when doing for each loop in a table.

I have used this many times in one task itself and I have changed the name as well for all the row still the error is there.

we cannot use for each loop for more than one time in the same task?


#3

you can, but name the variable other than “item”


#4

I am using row1 row2 row3
is it wrong?

For each row1 in tableXX
then for each item in row1

and so on…


#5

should work fine.

please post your recording here


#6

@azinchuk

i cannot replicate the scenario but i am using For each item in a list and under this i am using for each row in table.

even if the name is different it is still throwing error?

can we not use this loop inside another loop?