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

Require input to map Manager to the user

sairamya15
New Contributor III
New Contributor III

Hi All

we have a requirement to map a user manager using the manager ID for which I have mapped managerID to customproperty52 and configured the preprocess script. 

Kindly help with the query 

{
"ADDITIONALTABLES": {
"USERS": "SELECT USERNAME,FIRSTNAME,LASTNAME,CUSTOMPROPERTY52,STATUS,EMPLOYEEID,Owner FROM USERS"
},
"TABLEINDEXES": {
"currentusers": [
"username",
"employeeID"
],
"COMPUTEDCOLUMNS": [
"Owner"
],
"PREPROCESSQUERIES": ["Update NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.Owner = CASE WHEN ((NEWUSERDATA.CUSTOMPROPERTY52 != '')) THEN (select CURRENTUSERS.username from CURRENTUSERS where NEWUSERDATA.CUSTOMPROPERTY52 = CURRENTUSERS.employeeID) AND (NEWUSERDATA.OWNER IS NULL or NEWUSERDATA.OWNER = '') ELSE NULL END"
]
}

1 REPLY 1

rushikeshvartak
All-Star
All-Star

{
"ADDITIONALTABLES": {
"USERS": "SELECT USERNAME, FIRSTNAME, LASTNAME, CUSTOMPROPERTY52, STATUS, EMPLOYEEID, Owner FROM USERS"
},
"TABLEINDEXES": {
"currentusers": [
"username",
"employeeID"
],
"COMPUTEDCOLUMNS": [
"Owner"
],
"PREPROCESSQUERIES": [
"UPDATE NEWUSERDATA SET Owner = (SELECT username FROM CURRENTUSERS WHERE NEWUSERDATA.CUSTOMPROPERTY52 = CURRENTUSERS.employeeID AND (NEWUSERDATA.OWNER IS NULL OR NEWUSERDATA.OWNER = ''))"
]
}
}


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