- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2022 04:29 AM
Hi All,
I need to validate below excel data while doing transform load (before loading to table)
Validation should be like if the bae64 data is empty then it should not allow to load data.
Solved! Go to Solution.
- Labels:
-
Request Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2022 05:48 AM
you can use onbefore transform script
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
// Add your code here
if(source.u_base64_data.nil())
ignore = true;
})(source, map, log, target);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2022 06:48 AM
alert is client side and your script is server side
so please use gs.info() to check logs
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2022 06:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2022 07:17 AM
the logic is correct
try to debug further
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2022 12:39 AM
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
var cat_num = source.u_number;
var cat_item = source.u_item;
var fname = source.u_filename;
var ritmstate = source.u_state;
var contenttype = source.u_content_type;
var bae64 = source.u_base64_data;
//Source table map - ends here...
var category1,sub_category1,subcategory22,user_id,username,country,company,phone,assignment_group,company_sysid,asigntosysid,stateid,openstateid,rescatgsysid,clscode,urgcyvalue;
var errornote = " ";
var invaliderror = "";
var mandatoryerror = "";
var invalidmessage = "";
var statemessage = "";
var mandmessage = "";
if(source.u_base64_data == "")
{
ignore = true;
statemessage = "Missing Bae64data ";
errornote = statemessage;
source.u_error_reason = errornote;
}
if(source.u_file_name == "")
{
ignore = true;
statemessage = "Missing file name ";
errornote = statemessage;
source.u_error_reason = errornote;
}
//}
})(source, map, log, target);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2022 02:35 AM
Glad to know that it worked.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader