ERROR - expression doesn't trigger
# 🤝help
s
I think there might be a software problem while the expression: !workflow.horoscope && workflow.horoscope.length > 0 && workflow.horoscope[0].horoscope.length > 0 doesn't trigger when the workflow.horoscope[0].horoscope is "". Am I missing something? https://cdn.discordapp.com/attachments/1229748870494294167/1229748870821707796/image.png?ex=6630cfe2&is=661e5ae2&hm=0b9eae5cde0bca9261c3cd46542d85af62683e7a019961cac25b4c1d5063116c&
f
Can you show the whole setup?
g
@square-toddler-30705 what is not triggered as expected?
s
!workflow.horoscope && workflow.horoscope.length > 0 && workflow.horoscope[0].horoscope.length > 0 is not triggered when workflow.horoscope[0].horoscope is equal 0 Please see the previous message where you can see length value of 0 being printed after the Expression card which should take the user to AriesNoHoroscopeInTableYet
f
Have you tried using just 1 expression. Like !workflow.horoscope
Or
workflow.horoscope[0].horoscope = 0
Also
I don't think that expression can work 🙂
!workflow.horoscope: This condition checks if workflow.horoscope is falsy
`workflow.horoscope.length > 0`: This condition checks if the length property of
workflow.horoscope
is greater than 0. However, if workflow.horoscope is falsy (as checked in the previous condition), then the length can't be greater than 0
Etc.... with the rest
If you just want to check if
workflow.horoscope
is falsy then you can use just
!workflow.horoscope
You could use the or operator
||
instead of the and operator
&&
s
Thanks @fresh-fireman-491 , My mistake; I didn't see that AI was enabled and changed the expression. Should be: !workflow.horoscope || (workflow.horoscope && !workflow.horoscope[0])
f
Ah okay
s
Sorry for that 😅
f
No worries at all
s
Can you take a look at the translator agent and the problem I reported?
f
It happens, wasn't even your fault 🙂
I have, but there is unfortunately not much that I can do. I have sent it to the Botpress team though
s
OK, thanks I'm trying to run the bot but for one week I discover more and more issues 😉
I hope that the last screenshot will help to replicate this error. Thanks
16 Views