Why all data have not been loaded from transform map?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2024 09:19 PM - edited 09-11-2024 09:20 PM
Hi Community,
It seems like there is some issue with transform map field map script:-
answer = (function transformEntry(source) {
// Add your code here
var groupings=[];
if(source.u_iogc_grouping_1!=''){
var groupSysId1 = getEntityUpdateGroupSysId(source.u_iogc_grouping_1);
groupings.push(groupSysId1);
}
if(source.u_iogc_grouping_2!=''){
var groupSysId2 = getEntityUpdateGroupSysId(source.u_iogc_grouping_2);
groupings.push(groupSysId2);
}
if(source.u_iogc_grouping_3!=''){
var groupSysId3 = getEntityUpdateGroupSysId(source.u_iogc_grouping_3);
groupings.push(groupSysId3);
}
if(source.u_iogc_grouping_4!=''){
var groupSysId4 = getEntityUpdateGroupSysId(source.u_iogc_grouping_4);
groupings.push(groupSysId4);
}
if(source.u_iogc_grouping_5!=''){
var groupSysId5 = getEntityUpdateGroupSysId(source.u_iogc_grouping_5);
groupings.push(groupSysId5);
}
function getEntityUpdateGroupSysId(name) {
var gr = new GlideRecord('x_kpm79_kpmgi_iogc_em_iogc_grouping');
gr.addQuery('choice_value', name);
gr.query();
if (gr.next()) {
return gr.sys_id.toString();
}
}
return groupings.join(','); // return the value to be put into the target field
})(source);
I'm trying to load data to IOGC Grouping field(glide list type) but all data is not getting loaded.
excel data:-
data in instance:-
Could someone please help with the issue in code above?
Thanks,
Ankita
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2024 09:54 PM
Hi Ankita,
if(groupings.length == 5){
return groupings.join(',');
}
Just have this condition for testing before it returns.
Regards,
Dhanraj.