- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2024 08:24 AM
Apple adds a nefarious “S” on serial number bar codes attached to their packaging. Our import process starts at receiving and ends with discovery and have mismatched serial numbers duplicates caused by this. I’m attempting to add a script to the serial number transform map field, removing the leading “S” from serial numbers during the initial record load. But I’m having issues and would appreciate suggestions…. Thanks, Jim
answer = (function transformEntry(source) {
// Add your code here
var str = u_serial_id;
var mfc = u_descr254_mixed;
var newstr = "";
if (mfc.slice(0,5) == "Apple" && str.slice(0,1) == "S") {
let newstr = str.slice(1,9);
} else {
let newstr = str;
}
return newstr; // return the value to be put into the target field
})(source);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2024 08:30 AM
Hi @Jim O_Shea ,
Try below script,
answer = (function transformEntry(source) {
var str = source.u_serial_id;
var mfc = source.u_descr254_mixed;
var newstr = "";
if (mfc.slice(0, 5) === "Apple" && str.slice(0, 1) === "S") {
newstr = str.slice(1, 10);
} else {
newstr = str;
}
return newstr;
})(source);
Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2024 02:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2024 08:30 AM
Hi @Jim O_Shea ,
Try below script,
answer = (function transformEntry(source) {
var str = source.u_serial_id;
var mfc = source.u_descr254_mixed;
var newstr = "";
if (mfc.slice(0, 5) === "Apple" && str.slice(0, 1) === "S") {
newstr = str.slice(1, 10);
} else {
newstr = str;
}
return newstr;
})(source);
Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2024 02:10 PM
Thanks Anand!