update originalId:{x1:y x;$[ `=x1;x;.z.s[x1;y]]} [; Id!PrevId] each Id from table`
so basically if prev id is empty then stop iterating. How will that work i assume at each id it only has one map id!prev how will it iterate through to find the ultimate id?