Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Need to send null value in date field

aibasu
New Contributor III
New Contributor III

In the connection that I am creating I need to pass enddate or termdate if they are available . Otherwise "" or " " is getting accepted when I am trying to send using Postman . But in connector I am  facing the following problem :-

  • While trying to include logic for space or blank it does not work and throws error . I even tried using $null in the quotes but it does not work

{\"objectTypeAttributeId\":\"214\",\"objectAttributeValues\":[{\"value\":\"${if(user.enddate==null && user.termdate ==null){\" \"}else if(user.enddate==null){user.termDate.format('yyyy-MM-dd')}else{user.enddate.format('yyyy-MM-dd')}}\"}]}

  • Without logic of space it works correctly when enddate or termdate is available 

{\"objectTypeAttributeId\":\"214\",\"objectAttributeValues\":[{\"value\":\"${if(user.enddate==null){user.termDate.format('yyyy-MM-dd')}else{user.enddate.format('yyyy-MM-dd')}}\"}]}

Can anyone please help me with this ?

5 REPLIES 5

NM
Honored Contributor II
Honored Contributor II

Try this @aibasu 

{\"objectTypeAttributeId\":\"214\",\"objectAttributeValues\":[{\"value\":\"${if(user.enddate==null && user.termdate ==null){\"\"}else if(user.enddate==null){user.termDate.format('yyyy-MM-dd')}else{user.enddate.format('yyyy-MM-dd')}}\"}]}

Raghu
All-Star
All-Star

@aibasu  try below

{\"objectTypeAttributeId\":\"214\",\"objectAttributeValues\":[{\"value\":\"${user.enddate == null && user.termdate == null ? '' : (user.enddate == null ? user.termDate.format('yyyy-MM-dd') : user.enddate.format('yyyy-MM-dd'))}\"}]}


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

rushikeshvartak
All-Star
All-Star

{
"objectTypeAttributeId": "214",
"objectAttributeValues": [
{
"value": "${if(user.enddate == null && user.termdate == null) { '' } else if(user.enddate == null) { user.termdate.format('yyyy-MM-dd') } else { user.enddate.format('yyyy-MM-dd') }}"
}
]
}


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

aibasu
New Contributor III
New Contributor III

Hello All , 

Thanks a lot for trying to help me with this but none of the solutions are working as expected and are throwing errors .

Thanks !

What is error

Could you kindly provide a detailed snapshot of the information extracted from the logs, encompassing errors and other pertinent functionality details encountered during the execution of this process? Your assistance in furnishing this information would greatly aid in the analysis and resolution of any issues .



‼️‼️⚠️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.⚠️‼️‼️


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.