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

case statement and accountexpires attribute throwing error in updateaccountjson

sbiswal
New Contributor II
New Contributor II

Hello,

Encountering error with a few lines in an update account usecase.

The code is sort of this:

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

Here, flags and accountexpires are throwing a syntax error when I am trying to use them this way. Does anyone know an alternate way to write those lines?

Thank you,

Seemran Biswal

3 REPLIES 3

DixshantValecha
Saviynt Employee
Saviynt Employee

Please consider using the following code:

 

{
  ${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+'",'
  }
}

 

We kindly request you to verify this code and inform us if any further assistance is required.

Hello,

Thank you for this code; it worked.

Thanks!

DixshantValecha
Saviynt Employee
Saviynt Employee

Thanks for the Update.