03/16/2023 04:20 AM
Hello,
The usecase is that there should be no change in certain attribute if customproperty is 'noupdate'/ blank
These are the code lines that work:
"department": "${if(task?.accountKey.customproperty10 == '') {user?.departmentname} else {user.departmentname}}"
"department": "${if(task?.accountKey.customproperty10.equalsIgnoreCase('noupdate')) {user.departmentname} else {user?.departmentname}}"
However, they update in both cases. Does anyone know the variable to use if we want the past value to be retained?
(I've tried undefined keyword and saviyntnotchanged keyword already)
Also, on that note, am i wrong in assuming that {user?.departmentname} means latest value and {user.departmentname} is the already present value? Does it not work that way?
Thanks
03/16/2023 06:44 AM
saviyntnotchanged Should be capital
03/16/2023 07:24 AM
Hi,
I tried this:
"department": "${if(task?.accountKey.customproperty10 == '') {user?.departmentname} else (SAVIYNTNOTCHANGED)}"
but it's giving me error:
Error while Update operation for account-TestThree in AD - No such property: SAVIYNTNOTCHANGED for class: SimpleTemplateScript87
Our version is 2023.2, btw - I figured the keyword should work here. Or should I put in in {} instead of ()?