Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

Dont provision a specific attribute if dynamic attribute is blank

shubhamj596
Regular Contributor
Regular Contributor

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

23 REPLIES 23

rushikeshvartak
All-Star
All-Star

Use if else condition and pass undefined keyword in case if you don’t want to pass attribute 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

shubhamj596
Regular Contributor
Regular Contributor

{

"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

Yes don’t give single quote to undefined


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

shubhamj596
Regular Contributor
Regular Contributor

 

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

shubhamj596
Regular Contributor
Regular Contributor

Worked with using SAVIYNTNOTCHANGED keyword

Please share sample in previous accepted solution


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

shubhamj596
Regular Contributor
Regular Contributor

"Department":"${if((account.customproperty7 === null ? '' : account.customproperty7) === Department)(SAVIYNTNOTCHANGED) else (Department)}"

Regards,

Shubham

shibinvpkvr
Regular Contributor II
Regular Contributor II

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?

shubhamj596
Regular Contributor
Regular Contributor

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

shibinvpkvr
Regular Contributor II
Regular Contributor II

I tried to do that in AD connector but ${account.customproperty7} etc. is throwing error No such property: customproperty7 for class: java.lang.String

try using task.accountKey.customproperty7


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

thanks. ${task.accountKey.customproperty7} worked.

ASA
Regular Contributor II
Regular Contributor II

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?

use undefined keyword 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

ASA
Regular Contributor II
Regular Contributor II

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}}"

"E_MAIL": "${if(user.email!=null && user.email?.length() >0){user.email} else{undefined} }"

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

ASA
Regular Contributor II
Regular Contributor II

Same:

Error while createAccountSAP - No such property: undefined for class: SimpleTemplateScript1339

"E_MAIL":"${if(user.email!=null && user.email?.length() >0) ? user.email : (SAVIYNTNOTCHANGED) else (SAVIYNTNOTCHANGED)}"


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

ASA
Regular Contributor II
Regular Contributor II

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

Did you try this?

"E_MAIL": "${if(user.email == null || user.email.equals('')) {} else {user.email}}"

Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

ASA
Regular Contributor II
Regular Contributor II

If I do that the task doesn't even run into error because WSRETRY is terminating before 🙂

shubhamj596
Regular Contributor
Regular Contributor

SAVIYNTNOTCHANGED keyword is specific to the updateaccountjson. Doesnt work with createaccount.

ASA
Regular Contributor II
Regular Contributor II

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.