I think your issue is the same as this post. You are not properly referencing the identity ID from the loop context. Please see my reply to this other post on the correct JSONpath. This is assuming the value you put inside your loop context was just the $ .