and more in a single search tool across platforms. Read the announcement here. |
03/12/2024 06:48 AM
Hi Team,
We have requirement where we need to update display name based on first name and last name condition.
{ "ADDITIONALTABLES":
{ "USERS": "SELECT DISPLAYNAME, EMPLOYEETYPE, CUSTOMPROPERTY3, FIRSTNAME, LASTNAME, FROM USERS" },
"COMPUTEDCOLUMNS":
[ "DISPLAYNAME", "EMPLOYEETYPE", "CUSTOMPROPERTY3", "FIRSTNAME", "LASTNAME" ],
"PREPROCESSQUERIES":
[
"UPDATE NEWUSERDATA SET displayName = CONCAT(firstname,' ',lastname) where ((employeetype='Permanent Employee' and username='user.newjoiner11') and (displayName is null or displayName=''))",
"UPDATE NEWUSERDATA SET displayName = CONCAT(firstname,' ',lastname,'External') where ((customproperty3='89' and employeetype!='Permanent Employee' and username='user.newjoiner11') and (displayName is null or displayName=''))",
"UPDATE NEWUSERDATA SET displayName = CONCAT(firstname,' ',lastname,'Externe') where ((employeetype!='Permanent Employee' and username='user.newjoiner11') and (displayName is null or displayName=''))"
] }
we added this query in the pre processor json and when we triggered the job the attributes present in the query(firstname,lastname,cp3,employeetype) evrything became empty.
Is this happening because of the version, we are currently in 23.4 and we are facing this issue.
Can you please help us here.
Regards,
Varshitha
Solved! Go to Solution.
03/12/2024 06:55 AM
Hi @Varshi_Balaji ,
I see you have defined firstname,lastname,cp3,employeetype in the COMPUTEDCOLUMNS. But there is no query defined to set this value under the PREPROCESSQUERIES.
03/12/2024 06:58 AM - edited 03/12/2024 06:59 AM
Hi @Varshi_Balaji , is displayname coming from connector mappings? if yes then dont add it in computed columns again.
No need to have firstname and lastname also as computed columns. Same for cp3. Keep computed column blank if all attributes are part of mapping.
Thanks,
Amit
03/12/2024 09:45 AM
Hi AmitM
We tried by keeping the only one computed value that displayname still we are facing the error.
We are using the below preprocessor query:
{
"ADDITIONALTABLES": {
"USERS": "SELECT DISPLAYNAME,EMPLOYEETYPE FROM USERS"},
"COMPUTEDCOLUMNS": [
"DISPLAYNAME"
],
"PREPROCESSQUERIES": [
"UPDATE NEWUSERDATA SET displayName = CONCAT(firstname,' ',lastname) where ((employeetype='Permanent Employee' and username='user.newjoiner11') and (displayName is null or displayName=''))"
]
}
"Error in Users Import - Error while processing data: Unknown column 'employeeType' in 'where" clause'
Thanks,
Sai Meghana
03/12/2024 09:50 AM - edited 03/12/2024 09:52 AM
In your connector (user import mapping), have you mapped employeetype?
can you share you user import mapping?
Also it will help if you can explain your use case , why have you hard coded username? You expect it to run only for one user?
You are also not using additional tables but are having additional tables in preprocessor
03/12/2024 09:59 AM
No, we didn't mapped the emloyeetype
03/12/2024 10:24 AM
Make sure all columns exists in import file / from hr source which are used for display name population
03/12/2024 10:52 PM
Hi All,
We added the columns in the import user json and it is working as expected.
Thank you so much for the support.
Regards,
Varshitha