- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 08:43 PM
Hi
I have wrote an transform map script and it will compare the staging table user id value with actual table user id value and if matching, it bring the user name from table.
The issue is , in the user table , it has 5 records with same "user id" in which one is correct record and 4 are duplicates records and username is empty.
Because of that my transform map showing error.
Here is my script.
var gr_user = new GlideRecord("sys_user");
gr_user.addQuery("employee_number", source.u_comp_manager_id);
gr_user.query();
while (gr_user.next()) {
var com_mrg_id = gr_user.user_name;
}
gs.log('print target+com_mrg_id);
return com_mrg_id;
How to restrict the empty records being executed through while loop?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 09:20 PM
You can just add one line just before gr_user.query() statement,
gr_user.addNotNullQuery("user_name");
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 09:20 PM
You can just add one line just before gr_user.query() statement,
gr_user.addNotNullQuery("user_name");
Aman Kumar