Hi,
I have this code below in my app. It should be getting the users associate year and then inserting their seniority based on the number, for some reason it is marking everyone as a junior. Is there something wrong with this code? Is there a better way to do this?
Help please, thanks!
Fliplet.Hooks.on(‘beforeFormSubmit’, function(data) {
let associateYear = data[‘Associate Year’];
console.log('associate year ’ + associateYear);
var associateSeniority;
if (associateYear >= 4) {
associateSeniority = ‘Senior’;
} else {
associateSeniority = ‘Junior’;
}
data[‘Associate Seniority’] = associateSeniority;