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

If statement on account import mapping?

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on October 14 2020 at 22:00 UTC

Is it possible to do an if or case statement in the json account attribute mapping (AD connection for example)?

An example, I would like to populate a value to a custom property based on the useraccountcontrol value.


When I try this, it doesn't seem to work, but guessing I have the syntax incorrect Here is the important part of the mapping, and I am trying to say if the AD useraccountcontrol = 512, then set custom property 27 to "FALSE":


CUSTOMPROPERTY32::userAccountControl#String,

CUSTOMPROPERTY27::{userAccountControl==512 ? "FALSE"}#String


I have seen doing if statements in javascript json like this, but not sure how to format to work in Saviynt.

"if": { "CUSTOMPROPERTY32": 512 },     "then": { "CUSTOMPROPERTY27": "FALSE" },     "else": {         "CUSTOMPROPERTY27" : "TRUE"} 




This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.
2 REPLIES 2

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on October 14 2020 at 22:50 UTC

I do not think it is possible to do this on the account import section of the connector. However, you can use a custom query job to do this type of work post account import. Perhaps something like this might do the trick:


UPDATE

accounts a

JOIN endpoints e ON a.endpointkey = e.endpointkey

SET

a.customproperty27 = CASE WHEN a.customproperty32 = '512' THEN "FALSE" ELSE "TRUE" END

WHERE

e.endpointname = 'Active Directory'

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on October 15 2020 at 14:14 UTC

Ok, that's too bad. Your custom query worked with a few tweaks and had to change the " to '.

Thanks!

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.