When I use a “%” to check if x “Sessions” is a multiple of 7 (i.e. if its the seventh time user opened a session), it does NOT work (i.e. it produces True on every number, i.e. True for 2, for 3, for 4, etc.
Oddly, it works when I use Voiceflow’s native testing environment but NOT the Alexa Developer Console or Echo Device.
I’ve tried deleting the IF block and re-inputting the expression, but it doesn’t fix this.
Does anyone know what the issue is, or how to debug?
Thanks for the feedback, Kuniaki. Yes, I replicated the basic connections you did, with the same successful results.
However, this false positive bug persists in my project. The point of failure seems to be when comparing the expression result to a value, NOT the expression part. I debugged by adding error messages and reading out the variables. Most of the times (NOT ALL) the result of a x % y expression had the correct output; once or twice a x % y expression produced “unable to calculate expression, promised timed out after milliseconds”.
Any other ideas?
By the way, an interesting substitute for using a x % y expression for calculating every 7th session, is to use the Random step. For example, create a Random step with 7 paths, connect one path to your special case output (or happy path, aka “7th session”), and the 6 others ones to the usual case output. The result is similar execept randomized. The user only gets the special case once out of 7 times without being predictable. This is good for anything that should be sporadic and unpredictable, like upselling or reminding them of special features.