10-15-2022 05:19 PM
My source of truth is DB where I do not have username but users are uniquely identified by EmployeeID. The relation between user and Manager is also with EmployeeID.
I have to generate username in Saviynt (that is another problem, for now I am using OOTB username generation rule).
Now, when I am importing users, since username is generated in Saviynt, users are not getting linked to their managers. To solve this I wrote PREPROCESSOR as below:
"USERS": "SELECT username,employeeid from USERS "
"UPDATE NEWUSERDATA SET NEWUSERDATA.MANAGER=(select CURRENTUSERS.USERNAME from CURRENTUSERS where CURRENTUSERS.EMPLOYEEID = NEWUSERDATA.CUSTOMPROPERTY10)"
*CUSTOMPROPERTY10 has Manager's Employee number for user
This Preprocessor is working well and assigning manager correctly but the problem is coming when Manager is a new user and he/she is assigned as manager to existing users. So when the import runs, since this "new" manager user is not yet in "CURRENTUSERS" table, the manager field of existing users is cleared.
Only when the full import job runs second time the manager is assigned correctly as by this run the "new manager" is already created. If I run incremental import this change is never picked up the second time.
Could you please help and advise how can I assign manager when there is no username in source?
And if my PREPROCESSOR is correct then how can I mitigate the scenario where manager of existing user is cleared when manager is new employee.
10-19-2022 11:18 PM
Please try this:
"UPDATE NEWUSERDATA SET NEWUSERDATA.OWNER=(select CURRENTUSERS.USERNAME from CURRENTUSERS where CURRENTUSERS.EMPLOYEEID = NEWUSERDATA.CUSTOMPROPERTY10)"
10-20-2022 12:22 AM
Whenever you update owner field of users saviynt automatically find manager and mapped to user