Any assistance would be greatly appreciated!
I have a Serial Number (SN#) that is labeled "Locker Name". I want to make sure that the SN# is 7 Characters/Digits before finishing the automation as sometimes it get typed in wrong. the SN# format is NS01234 or NS00123. People leave off the 0's from time to time. i want to create a new record with this number in a new table. Linking is not option here. Here is what i am trying to do but i am getting this error:
let sn = input.config.LockerName;
let updatedSN = '';
if (sn.length === 5) {
updatedSN = 'NS00' + sn.slice(-3);
} else if (sn.length === 6) {
updatedSN = 'NS0' + sn.slice(-4);
} else if (sn.length === 7) {
updatedSN = sn;
} else {
updatedSN = 'Invalid SN#';
}
output.set('updatedSN', updatedSN);