and more in a single search tool across platforms. Read the announcement here. |
03/03/2023 02:00 AM - edited 03/03/2023 02:48 AM
Hello,
we have a usecase where we only want the attribute to be updated if there's a null value/ or if it is not populated by a 'noupdate' value in a customproperty10. what should be the syntax for that?
So far, I've tried these:
"l":"${if(account.customproperty10.isEmpty()) ${user?.city}}",
"l": "${if(account.customproperty10.equalsIgnoreCase('')) ${user?.city}}"
"l": "${if(account.customproperty10.equals('')) ${user?.city}}"
"l":"${if(account.customproperty10 ==null)${user?.city}}"
"l":"${if((account.customproperty10 === null ? '' : account.customproperty10) === user.city)(SAVIYNTNOTCHANGED) else {user?.city}}"
"department":"${if(account.customproperty10 !=null) else ${user?.departmentname}}"
"l": "${if(account.customproperty10 != 'noupdate'))${user.city}}",
All of these are giving me error. Is there any other syntax i can use?
Thanks in advance!
03/03/2023 05:34 AM - edited 03/03/2023 05:35 AM
I appreciate you reaching out to the Saviynt forums.
To update the attribute only if it is null or not populated with a "noupdate" value in customproperty10, you can use the following syntax:
syntax:- "l":"${if(account.customproperty10 == null || account.customproperty10.equalsIgnoreCase('noupdate')) ${user?.city} else account.customproperty10}"
This syntax checks if account.customproperty10 is null or equal to "noupdate". If either condition is true, it updates the attribute with the value of user.city. Otherwise, it keeps the existing value of account.customproperty10.
I hope this helps! Let me know if you have any further questions.
03/06/2023 02:56 AM
Hello,
Thanks for the code. However, I am getting the below error on it:
Error while Update operation for account-Tousif in AD - No such property: customproperty10 for class: java.lang.String
Would you have any input on what his error means? Is it syntax related or something else?
Thank you,
Seemran Biswal
03/06/2023 03:54 PM
Looks like when CPxx didn't have values it is not even exposed. You may have to assign some default value to respective CPxx to achieve your logic.
Just confirm the same try to update cp10 with value Test and change the logic to below and see if it works
"l":"${if (account.customproperty10=='Test' || !(account.customproperty10.equalsIgnoreCase('noupdate'))) {user?.city}}}"
03/07/2023 03:03 AM
Hello,
Thanks for the suggestion. I tried your approach, and then different variations of that, using the variable update instead of test, but it still gave me the same error for some reason.
Do you have any other reason/ approach to this?
Thanks
03/03/2023 06:10 AM
Try below mapping
"l":"${if (null == account.customproperty10 || account.customproperty10=='' || !(account.customproperty10.equalsIgnoreCase('noupdate'))) {user?.city}}}"
03/06/2023 05:47 AM
Thanks for the update,Kindly try below mapping and let us know if further assistance is needed from our end.
mapping
"l":"${if (null == account.customproperty10 || account.customproperty10=='' || !(account.customproperty10.equalsIgnoreCase('noupdate'))) {user?.city}}}"
04/12/2023 04:24 AM - edited 04/12/2023 04:28 AM
Thanks for the update, Kindly try below mapping and let us know if further assistance is needed from our end.
First mapping:-
"l": "${account.customproperty10 == null || account.customproperty10 != 'noupdate' ? user?.city : 'SAVIYNTNOTCHANGED'}"
Second:-
"l": "${((account.customproperty10 == null || account.customproperty10.isEmpty()) && account.customproperty10 != 'noupdate') ? user?.city : account.customproperty10}"