Hi All!
I'm kind of stuck trying to compare two embedded fields in survey flow using branch logic. I suspect it may not be working because one embedded field is string and the other date. We use some JavaScript to convert the separation date into a month number string-type variable called sep_Month. Ultimately comparing current month (date) to separation month (string), then using branch logic to add 12 to current month if it is less than separation month. We then use a math operation to compare the two and end survey if greater than three months difference (kind of expiring the link).
Example of what is happening: Current month is '01' and separation month is '9'. Math produces '-8' (01 - 9 = -8), but with the +12 part in place we think the math should be producing '4' (13 - 9 = 4).
Any help on why this is not working at the 'add 12' part and/or how to correct would be most appreciated!
It may be the JavaScript that is wrong, since I'm trying to reverse engineer off Google...
Thank you!
Rob
Best answer by ahmedA
View original