and more in a single search tool across platforms. Read the announcement here. |
11/10/2022 11:05 PM
Hi Everyone,
In our environment, we are using SAP connector in which we cant control the import.
So for we have a department field, which needs to be provisioned to the SAP account but there's no way we can reconcile.
We can store the department in any of the account CP but only for those who have been provisioned through Saviynt.
Now, in our account creation form, we have a whole bunch of dynamic attributes in which most of the fields would be null as they are not getting imported to Saviynt.
For example - Department.
Now, if someone wants to update the department of the account, he/she can basically add that in the form and updateaccounttask would be triggered.
But if someone is keeping it as blank and updating other fields in the form, is there a way in can define in the JSON that, if department field i null, skip department provisioning?
Scenario:
2 dynamic attribute:
1. Validto - coming from SAP as 2022-12-31
2. Department - Blank(But in SAP value is there)
Now, the user only wants to update the validto to 2023-12-31, but if i add department as well in the updateaccountjson, it would be provisioned as blank.
Sample JSON:
{
ADDRESS:{
"FIRSTNAME":"${user?.firstname}",
"E_MAIL":"${user?.email}",
"LASTNAME":"${user?.lastname}",
COMM_TYPE:INT
},
"LOGONDATA": {
"USTYP": "A"
}
}
Note : This is for SAP connector
Solved! Go to Solution.
11/10/2022 11:07 PM
Use if else condition and pass undefined keyword in case if you don’t want to pass attribute
11/11/2022 12:51 AM
{
"department":"${if(department_dynamic == null)('undefined') else {department_dynamic}}"
}
Where department_dynamic is the dynamic attribute.
Is this the one you are talking about?
Regards,
Shubham
11/11/2022 09:24 PM
Yes don’t give single quote to undefined
11/14/2022 02:04 AM
Hi Rushikesh,
Undefined keyword is making the values null, below is the JSON.
{
"ADDRESS": {
"E_MAIL": "${if(Email == null)(undefined) else {Email}}",
"DEPARTMENT": "${if(Department == null)(undefined) else {Department}}",
"COMM_TYPE": "INT"
},
"LOGONDATA": {
"GLTGV": "${if(ValidFrom == null)(undefined) else {ValidFrom}}"
}
}
It is actually provisioning the below JSON:
{
"ADDRESS": {
"E_MAIL": "",
"DEPARTMENT": "",
"COMM_TYPE": "INT"
},
"LOGONDATA": {
"GLTGV": "20221212"
}
Regards,
Shubham
11/16/2022 01:29 AM
Worked with using SAVIYNTNOTCHANGED keyword
11/16/2022 04:21 AM
Please share sample in previous accepted solution
11/16/2022 09:53 PM
11/29/2022 04:43 PM
Can we use this in AD connection? or is there an equivalent keyword/method to do this in AD? I tried using SAVIYNTNOTCHANGED but that did not work. also how do we access account properties in ad updateaccountjson?
11/29/2022 10:30 PM
SAVIYTNOTCHANGED may not work for AD, its specific to connector.
account property you can use by using account before the property name. For eg account.name or account.customproperty1
Regards,
Shubham
11/30/2022 06:01 AM
I tried to do that in AD connector but ${account.customproperty7} etc. is throwing error No such property: customproperty7 for class: java.lang.String
11/30/2022 09:45 AM - edited 11/30/2022 02:52 PM
try using task.accountKey.customproperty7
11/30/2022 01:02 PM
thanks. ${task.accountKey.customproperty7} worked.
12/15/2022 05:31 AM
I have a similar issue with email address on create. If we pass empty value it gets rejected by SAP. Reading this thread I tried this:
"E_MAIL": "${if(user.email == null || user.email.equals('')) {SAVIYNTNOTCHANGED} else {user.email}}"
but I'm getting:
Error while createAccountSAP - No such property: SAVIYNTNOTCHANGED for class: SimpleTemplateScript2994
Error while createAccountSAP - No such property: SAVIYNTNOTCHANGED for class: SimpleTemplateScript2996
How can I do this in CREATEACCOUNTJSON?
12/15/2022 05:34 AM
use undefined keyword
12/15/2022 06:02 AM
Basically the same:
Error while createAccountSAP - No such property: undefined for class: SimpleTemplateScript3000
with
"E_MAIL": "${if(user.email == null || user.email.equals('')) {undefined} else {user.email}}"
12/15/2022 06:17 AM
12/15/2022 06:19 AM
Same:
Error while createAccountSAP - No such property: undefined for class: SimpleTemplateScript1339
12/15/2022 06:26 AM
"E_MAIL":"${if(user.email!=null && user.email?.length() >0) ? user.email : (SAVIYNTNOTCHANGED) else (SAVIYNTNOTCHANGED)}"
12/15/2022 06:42 AM
Also not working but I think you have mixed it up a little in the syntax. There is an if/else and also a shortened if with ?:
Tried to clean it up but still not working:
Error while createAccountSAP - No such property: SAVIYNTNOTCHANGED for class: SimpleTemplateScript3003
12/16/2022 03:03 PM
Did you try this?
"E_MAIL": "${if(user.email == null || user.email.equals('')) {} else {user.email}}"
12/20/2022 12:43 AM
If I do that the task doesn't even run into error because WSRETRY is terminating before 🙂
12/19/2022 12:54 AM
SAVIYNTNOTCHANGED keyword is specific to the updateaccountjson. Doesnt work with createaccount.
12/20/2022 12:44 AM
Yes, I got that from the few initial posts. Question is if you can achieve the same behaviour (don't provision empty value at all) in CREATEACCOUNTJSON.