The CreatorCon Call for Content is officially open! Get started here.

Field Map - Source Script

ramkutva
Kilo Explorer

I have one of the field as reference in target table.I need to import the values from the excel file,which contains the value of the field.So i used the field map source script to fetch the sys id of it & thereby to set the value in reference field of the target table.The script is working fine when i try in Script Background but its not in Source script of the field Map.Following is the script part:



var impact=source.fieldname;
var imp_ci=new GlideRecord('table name');
imp_ci.addQuery('name',impact);
imp_ci.query();
if(imp_ci.next()){
answer=imp_ci.sys_id;
}

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Ram,

Any update on this?
Can you mark my answer as correct, helpful if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader