Integration hub import data from excel and transform target fields before inserting
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 11:07 PM
I am trying to load data from excel to servicenow table using integration hub imports. Before inserting the data to target table , I have to set few extra fields for which mappings were not there. I am using beforeRun script to set the values before inserting but they are failing to do. below is the code used in beforeRun script
(function onBefore(source, target, importLog) {
var id=source["u_id"];
var glideRecord=new GlideRecord("csm_consumer");
glideRecord.addQuery("number",id);
glideRecord.query();
if(glideRecord.next()){
ignore=true;
ignore_reason='consumer already exist with this id';
importLog.warn("consumer already exist with this id-"+id);
}
target['active']=source['u_firstname']&&source['u_email']; // need to set active to true if firstname and email are there
// this active field will not be sent in the data source(excel)
})(source, target, importLog);
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 10:27 AM
I have the same issue, did you find a solution on this?