10-31-2022 06:03 AM
Hi,
I have a connection with ImportUserJSON. If I want to fill the Manager field, IT need to be the userkey of the existing user of saviynt correct?
Because we have existing ImportUserJSON made by consultant and for Manager, it set the manager email and because of that I think it cause problem with the user update account each time our job run.
Can someone confirm me that Manager need userkey instead of email?
thanks
Solved! Go to Solution.
10-31-2022 06:52 AM
Manager is always userkey but you can add username as owner field in users. Can you provide more info some missing info in post
10-31-2022 07:10 AM
ImportUserJSON
{
"connection":"userAuth",
"url":"",
"httpMethod":"GET",
"httpHeaders":{
"Accept":"application/json",
"Authorization":"${access_token}"
},
"colsToPropsMap":{
"USERNAME":"Email~#~char",
"CITY":"Job.LocationWork.City~#~char",
"COMPANYNAME":"Job.Company.Name~#~char",
"COSTCENTER":"Job.CostCenter~#~char",
"DISPLAYNAME":"Name.Formatted~#~char",
"EMAIL":"Email~#~char",
"EMPLOYEETYPE":"Job.EmploymentStatus.Name~#~char",
"EMPLOYEEID":"EmployeeNumber~#~char",
"FIRSTNAME":"Name.GivenName~#~char",
"JOB_ID":"Job.Id~#~char",
"JOB_FUNCTION":"Job.Title.JobCode~#~char",
"TITLE":"Job.Title.Name~#~char",
"LASTNAME":"Name.FamilyName~#~char",
"LOCATION":"Job.LocationWork.Name~#~char",
"LOCATIONNUMBER":"Job.LocationCode~#~char",
"MANAGER":"Manager.Email~#~char",
},
"errorCode":"400",
"errorCodePath":"errorCode",
"userResponsePath":""
}
10-31-2022 07:16 AM
I dont think it will map your manager to user. hence use pre processor to correctly map manager for user
10-31-2022 07:29 AM
So in the MODIFYUSERDATAJSON I'll add that there correct?
10-31-2022 07:35 AM
10-31-2022 09:42 AM
I have something like this for the preprocessqueries in ModififyUserDataJson. I receive an error. Does I miss something?
{
"ADDITIONALTABLES": {
"USERS": "SELECT STATUSKEY,CUSTOMPROPERTY1,MANAGER,OWNER FROM USERS"
},
"COMPUTEDCOLUMNS": [
"STATUSKEY",
"OWNER"
],
"TABLEINDEXES": {
"currentusers": [
"username",
"userkey"
]
},
"PREPROCESSQUERIES": [
"UPDATE NEWUSERDATA SET STATUSKEY = CASE WHEN CUSTOMPROPERTY1='Active' THEN '1' ELSE '0' END",
"UPDATE NEWUSERDATA JOIN CURRENTUSERS ON NEWUSERDATA.OWNER = CURRENTUSERS.USERNAME SET NEWUSERDATA.MANAGER = CURRENTUSERS.USERKEY"
]
}
10-31-2022 09:46 AM
10-31-2022 09:52 AM
yeah with status it working fine ( thatat was something already there before I add the other update)
error on job history is :
Error - to Import Data correctly: Error in Users
Import - Error while processing data: Unknown
column 'TEMPNEWUSERS_472709.MANAGER' in 'field
list'
10-31-2022 09:58 AM - edited 10-31-2022 09:59 AM
"UPDATE NEWUSERDATA JOIN CURRENTUSERS ON NEWUSERDATA.OWNER = CURRENTUSERS.USERNAME SET NEWUSERDATA.OWNER= CURRENTUSERS.USERNAME "
or
"UPDATE NEWUSERDATA SET NEWUSERDATA.OWNER=(select CURRENTUSERS.USERNAME from CURRENTUSERS where CURRENTUSERS.EMPLOYEEID = NEWUSERDATA.CUSTOMPROPERTY10)"
10-31-2022 10:03 AM
Ok so by setting the Owner field it will set the Manager field?
10-31-2022 10:17 AM
I just try it it and instead of "MANAGER":"Manager.Email~#~char", I place "OWNER":"Manager.Email~#~char", in ImportUser Json it work. so this is the fix.
@rushikeshvartak thanks