Creating a Transform Map to upload records if the Employee_number is not blank
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2024 12:46 PM
Good Day,
i am having issues here, i have created a DataSource that is linked to a SQL staging table.
In this table it has employee_numbers and also a Department Code for the Sys_user table
What i want to do, is to first check if the employee_number exist on the Sys_user table and if so then Update the Department code in the u_department_code field i created on the sys_user table
I tried the Coalesce Field of the Employee_number to be indexed on the sys_user table and then update the department_code base on that however i found out some records doesnt have an Employee_number which cause the transform map to create Ghost records with no name or details just the eomployee number and department code
please help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2024 04:00 PM
Hello @Peter Williams
Write onBefore script to check if the employee number is empty or not. If empty ignore that particular record inserting into the user table.
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
// Add your code here
if (gs.nil(source.employee_number)) { //update with your actual employee number field
ignore = true;
}
})(source, map, log, target);
Hope it helps:)
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2024 04:02 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2024 05:17 AM
Thank you i was able to figure it out and created this script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 12:22 PM
@Peter Williams Got it!
Murthy