Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Create Account json throwing attribute conversion error

Prajna
New Contributor
New Contributor

Hi Team,

We have configured create account json for active directory. We are getting attribute conversion error for account expires attribute. The json for account expires is mentioned below
{

"accountExpires":"${if(user.customproperty15=='Permanent Full-time' && user.enddate==null) {'Never'} else {user.endadate}}"

}

Please suggest.

2 REPLIES 2

rushikeshvartak
All-Star
All-Star

It should be date and not string instead of Never.

sample

 

{
  ${if (task?.accountKey.customproperty10 == '')
    '"givenname" : "'+user?.firstname+'",
    "flags": "' + (user.employeeType=='Industrial'? '2' : (user.employeeType=='Commercial'? '1' : '')) + '",'
  else
    '"accountExpires": "' + (user?.getEnddate()?.toInstant()?.toEpochMilli() - (-11644494808000 * 10000)) + '", 
    "sn" : "'+user?.lastname+'",'
  }
}

 

Use below 

{
"accountExpires":"${if((user?.customproperty15=='Permanent Full-time') && (user.enddate==null)) {'0'} else {10000*(user.enddate.getTime() + 11644473600000)}}"
}

 


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

draut
New Contributor III
New Contributor III

Hi @Prajna 

Try with this

{
"accountExpires":"${if((user?.customproperty15=='Permanent Full-time') && (user.enddate==null)) {'0'} else {10000*(user.enddate.getTime() + 11644473600000)}}"
}
Dheeraj