and more in a single search tool across platforms. Read the announcement here. |
03/11/2024 03:45 AM
Hi ,
We are trying to ensure the not null check in the update account json like the account should get updated if the attributes got updated with not null values
However , even after ensuring the not null check the attributes are getting updated with null values
PFB the json being leveraged
{
"co": "${if(user.customproperty32!=null){user.customproperty32}}",
"c": "${if(user.country!=null){user.country}}",
"title": "${if(user.title!=null){user.title}}",
"st": "${if(user.state!=null){user.state}}",
"division": "${if(user.customproperty16!=null){user.customproperty16}}",
"physicalDeliveryOfficeName": "${if(user.locationdesc!=null){user.locationdesc}}",
"streetAddress": "${if(user.street!=null){user.street}}",
"department": "${if(user.departmentname!=null){user.departmentname}}",
"countryCode": "${if(user.customproperty33!=null){user.customproperty33}}",
"company": "${if(user.customproperty17!=null){user.customproperty17}}",
"extensionAttribute13": "${if(user.locationnumber!=null){user.locationnumber}}",
"extensionAttribute14": "${if(user.customproperty27!=null){user.customproperty27}}",
"extensionAttribute8": "${if(user.customproperty27!=null){user.customproperty27}}",
"extensionAttribute1": "${if(user.employeeid!=null){user.employeeid}}",
"manager": "${if(user.manager!=null){user.manager}}",
"employeeID": "${if(user.employeeid!=null){user.employeeid}}",
"manager": "${if(user.manager!=null){managerAccount?.comments}}",
"telephoneNumber": "${if(user.phonenumber!=null){user.phonenumber}}",
"extensionAttribute6": "${if(user.customproperty12!=null){user.customproperty12}}",
"l": "${if(user.city!=null){user.city}}",
"postalCode": "${if(user.customproperty13!=null){user.customproperty13}}",
"extensionAttribute4": "${user.leaveStatus =='LEAVE'? 'exclude':''}",
"extensionAttribute11": "${user.leaveStatus =='LEAVE'? 'exclude':''}",
"msExchExtensionAttribute24": "${user.country =='US'? 'US':'INTL'}",
"msExchExtensionAttribute23": "${user.employeeType =='Employee'? 'FTE':'NE'}",
}
please suggest what changes shall be made
Thanks
Abdul Gaffar
03/11/2024 04:48 AM
@Abdul_Gaffar can you try below condition also include
all same way
co": "${if(user.customproperty32!=null) &&(user.customproperty32!=""){user.customproperty32}}",
03/11/2024 06:03 AM
Hi @CR ,
I did as you have suggested above except specifying '' insted of "" in the condition
However , I am getting error as below:
Error while Update operation for account-ntestdev in AD - Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript163.groovy: 2: unexpected token: && @ line 2, column 45. (user.customproperty32!=null) &&(user.cu ^ 1 error
can you please specify is it with single quotes or double quotes to be supported
Regards
Abdul Gaffar
03/12/2024 02:32 AM
I belive below one also you tried?
"${if(user.customproperty32!=null) &&(user.customproperty32!=''){user.customproperty32}}",
03/12/2024 06:05 AM
Hi @CR ,
Yes I did
"co": "${if(user.customproperty32!=null) &&(user.customproperty32!=''){user.customproperty32}}"
Then getting error like " Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript163.groovy: 2: unexpected token: && @ line 2, column 45. (user.customproperty32!=null) &&(user.cu ^ 1 error"
Regards
Abdul Gaffar
03/12/2024 06:28 AM
added now all '?'
try it
{
"co": "${if(user?.customproperty32!=null){user?.customproperty32}}",
"c": "${if(user?.country!=null){user?.country}}",
"title": "${if(user?.title!=null){user?.title}}",
"st": "${if(user?.state!=null){user?.state}}",
"division": "${if(user?.customproperty16!=null){user?.customproperty16}}",
"physicalDeliveryOfficeName": "${if(user?.locationdesc!=null){user?.locationdesc}}",
"streetAddress": "${if(user?.street!=null){user?.street}}",
"department": "${if(user?.departmentname!=null){user?.departmentname}}",
"countryCode": "${if(user?.customproperty33!=null){user?.customproperty33}}",
"company": "${if(user?.customproperty17!=null){user?.customproperty17}}",
"extensionAttribute13": "${if(user?.locationnumber!=null){user?.locationnumber}}",
"extensionAttribute14": "${if(user?.customproperty27!=null){user?.customproperty27}}",
"extensionAttribute8": "${if(user?.customproperty27!=null){user?.customproperty27}}",
"extensionAttribute1": "${if(user?.employeeid!=null){user?.employeeid}}",
"manager": "${if(user?.manager!=null){user?.manager}}",
"employeeID": "${if(user?.employeeid!=null){user?.employeeid}}",
"manager": "${if(user?.manager!=null){managerAccount?.comments}}",
"telephoneNumber": "${if(user?.phonenumber!=null){user?.phonenumber}}",
"extensionAttribute6": "${if(user?.customproperty12!=null){user?.customproperty12}}",
"l": "${if(user?.city!=null){user?.city}}",
"postalCode": "${if(user?.customproperty13!=null){user?.customproperty13}}",
"extensionAttribute4": "${user?.leaveStatus =='LEAVE'? 'exclude':''}",
"extensionAttribute11": "${user?.leaveStatus =='LEAVE'? 'exclude':''}",
"msExchExtensionAttribute24": "${user?.country =='US'? 'US':'INTL'}",
"msExchExtensionAttribute23": "${user?.employeeType =='Employee'? 'FTE':'NE'}",
}
03/19/2024 01:56 AM
Hi @CR ,
I tried this suggestion , however the attributes are still getting updated with null values
If there is any other way to ensure that no null values are getting updated at target level
Thanks
Abdul Gaffar
03/11/2024 06:06 AM
Hi @Abdul_Gaffar , This should work.
"streetAddress": "${user.street!=null?user.street:''}"
Thanks,
Amit
If this answers your query, Please ACCEPT SOLUTION and give KUDOS.
Thanks,
Amit
03/12/2024 02:09 AM
Hi @AmitM ,
The update to null is what we are trying to omit as in if source sends a null value it shouldnt get updated
for instance "streetAddress": "${user.street!=null?user.street:''}" if street is null then the account gets updated with a null value , which is what we are trying to avoid here.
Regards
Abdul Gaffar
03/12/2024 03:01 AM
Okay , In this doc search HashMap and use the Json Builder method for Update account Json -https://docs.saviyntcloud.com/bundle/AD-v24x/page/Content/Configuring-the-Integration-for-Provisioni...
If the attribute is null don't add it to map. Don't write this line else map1.put('birthdate','');
Thanks,
Amit
If this answers your query, Please ACCEPT SOLUTION and give KUDOS.
03/12/2024 10:54 AM
{
"co": "${user.customproperty32 != null ? user.customproperty32 : ''}",
"c": "${user.country != null ? user.country : ''}",
"title": "${user.title != null ? user.title : ''}",
"st": "${user.state != null ? user.state : ''}",
"division": "${user.customproperty16 != null ? user.customproperty16 : ''}",
"physicalDeliveryOfficeName": "${user.locationdesc != null ? user.locationdesc : ''}",
"streetAddress": "${user.street != null ? user.street : ''}",
"department": "${user.departmentname != null ? user.departmentname : ''}",
"countryCode": "${user.customproperty33 != null ? user.customproperty33 : ''}",
"company": "${user.customproperty17 != null ? user.customproperty17 : ''}",
"extensionAttribute13": "${user.locationnumber != null ? user.locationnumber : ''}",
"extensionAttribute14": "${user.customproperty27 != null ? user.customproperty27 : ''}",
"extensionAttribute8": "${user.customproperty27 != null ? user.customproperty27 : ''}",
"extensionAttribute1": "${user.employeeid != null ? user.employeeid : ''}",
"manager": "${user.manager != null ? user.manager : ''}",
"employeeID": "${user.employeeid != null ? user.employeeid : ''}",
"manager": "${user.manager != null ? managerAccount.comments : ''}",
"telephoneNumber": "${user.phonenumber != null ? user.phonenumber : ''}",
"extensionAttribute6": "${user.customproperty12 != null ? user.customproperty12 : ''}",
"l": "${user.city != null ? user.city : ''}",
"postalCode": "${user.customproperty13 != null ? user.customproperty13 : ''}",
"extensionAttribute4": "${user.leaveStatus == 'LEAVE' ? 'exclude' : ''}",
"extensionAttribute11": "${user.leaveStatus == 'LEAVE' ? 'exclude' : ''}",
"msExchExtensionAttribute24": "${user.country == 'US' ? 'US' : 'INTL'}",
"msExchExtensionAttribute23": "${user.employeeType == 'Employee' ? 'FTE' : 'NE'}"
}
03/19/2024 01:54 AM
Hi @rushikeshvartak ,
I tried as per your suggestion above
However we are getting the null values getting updated at target
To ensure this SUPPORTEMPTYSTRING field is also set to false
However , the null values are still getting updated on the target accounts
Thanks & regards
Abdul Gaffar