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

Map manager with username of current user import

Abdul_Gaffar
New Contributor II
New Contributor II

Hi ,

we are trying to map the manager with current manager username at the user's update history it is displaying as the manager's field is updated.However, the same does not get replicated when we look around the user profile

below is the preprocessor query leveraged to update the manager and following is the error am facing through 

The new userdata has saviynt generated username but the same is not visible in the user profile

preprocessor query:

{
"ADDITIONALTABLES": {
"USERS": "SELECT USERKEY FROM USERS"
},
"COMPUTEDCOLUMNS": [
"customproperty20",
"DISPLAYNAME",
"MANAGER"
],
"PREPROCESSQUERIES": [
"UPDATE NEWUSERDATA SET CUSTOMPROPERTY20 ='Workday'",
"UPDATE NEWUSERDATA SET DISPLAYNAME = CONCAT(lastname,'',ifnull(substring(middlename,1),''),'',firstname)",
"UPDATE NEWUSERDATA SET NEWUSERDATA.MANAGER=(select CURRENTUSERS.USERNAME from CURRENTUSERS where CURRENTUSERS.EMPLOYEEID=NEWUSERDATA.MANAGER)"
]
}

Error: Error in Users Import - Error while processing data: Unknown column 'TEMPUSERS_8999.USERNAME' in 'field list'

please suggest the correct query to update the manager field

Regards,

Abdul Gaffar

11 REPLIES 11

dgandhi
All-Star
All-Star

Can you also add username in below query and check?

"USERS": "SELECT USERKEY,USERNAME FROM USERS"
},

Thanks

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

Hi @dgandhi ,

The following is the error message just as above:

Error in Users Import - Error while processing data: Unknown column 'TEMPUSERS_9000.EMPLOYEEID' in 'where clause'

Include all the columns that will be used in your computation. Can you add Employeedid also in the above query and check?

"USERS": "SELECT USERKEY,USERNAME,EMPLOYEEID FROM USERS"

Thanks

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

Hey @dgandhi ,
the error is as follows:

Error in Users Import - Error while processing data: Subquery returns more than 1 row

Thanks,

Abdul Gaffar

The original issue is resolved, this is an issue in the logic of your query.

Thanks

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

Abdul_Gaffar
New Contributor II
New Contributor II

Ok , but how shall this be addressed please elaborate

Thanks,

Abdul Gaffar

Can you please elaborate more on the use case that you are trying to achieve. Its not quite clear.

Thanks

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

Abdul_Gaffar
New Contributor II
New Contributor II

Hey @dgandhi ,

The users have been updated with the manager field via user import job as follows

Abdul_Gaffar_0-1684945391029.png

However, we cannot see the same if we go to user details pane as it still shows the old value (starts with 000) and this oldvalue is basically the employeeid of the manager

to update the manager field with the updated username I tried with the above specified preprocessor query and facing issues as shown above 

Thanks,

Abdul Gaffar

I don't understand the use case. If manager was updated as part of rule and it is showing in the update history but not reflecting on user's UI then that needs to be fixed ( why on UI the new manager is not reflecting correctly.)

Thanks

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

along with manager also update owner field


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

Abdul_Gaffar
New Contributor II
New Contributor II

Hi @dgandhi @rushikeshvartak 

Yes , not sure why the updated manager is not visible even after update in the manager value

and I did specify owner in the preprocessor query as follows:

{
"ADDITIONALTABLES": {
"USERS": "SELECT USERKEY,USERNAME,EMPLOYEEID FROM USERS"
},
"COMPUTEDCOLUMNS": [
"customproperty20",
"DISPLAYNAME",
"MANAGER",
"OWNER"
],
"PREPROCESSQUERIES": [
"UPDATE NEWUSERDATA SET CUSTOMPROPERTY20 ='Workday'",
"UPDATE NEWUSERDATA SET DISPLAYNAME = CONCAT(lastname,'',ifnull(substring(middlename,1),''),'',firstname)",
"UPDATE NEWUSERDATA SET NEWUSERDATA.MANAGER=(select CURRENTUSERS.USERNAME from CURRENTUSERS where CURRENTUSERS.EMPLOYEEID=NEWUSERDATA.MANAGER)"
]
}

and the error is "

Error in Users Import - Error while processing data: Subquery returns more than 1 row

" and as the error specifies it returns more than 1 row if the query can be like

UPDATE NEWUSERDATA SET NEWUSERDATA.MANAGER=(select CURRENTUSERS.USERNAME from CURRENTUSERS 

Thanks,

Abdul Gaffar