Hi! I’ve been trying to get the last previous value of an attribute. So, if there was a modification from values “X01” to “X02” and finally “X03”, i always need to read the n-1 previous value, that would be “X02” here.
I tried using this transform, but i always get the first value there was in this attribute, for example X01. Code attached. Any idea? Thanks!
Issue here is it $oldValue will always be the first none null value and will never be updated after that. So in the case where source attribute values change from “X01” to “X02” and finally “X03”, the $oldValue will forever be “X01” (for this transform)
You can try the below transform which returns old value when account attribute is not empty/null and both new and old values are not equal, otherwise it returns new value.