Value is not captured after failed validation and ...
# 🤝help
f
I created a validation function for phone numbers and it works and then I set up a number of retries. When I tried to test it out by providing correct value after retry it had passed validation, but it was not captured though it claims it was as you can see on the screenshot
a
Hey @fancy-fireman-70630 what does your capture card look like?
f
sorry for late response, still couldn't figure it out
a
is your workflow variable
phoneNumber
a string or number? There could be a type error preventing it being saved if the varType is string but the phone number is a number.
f
I tried both and had the same issue
a
are you moving between workflows or is everything in main?
f
Just main
a
hmm. Would you mind sharing your bot?
no like the .bpz file
f
I tried the published bot and it behaves so weird lol. Like works completely random rather than in the editing dashboard
a
ok I figured out what was going on. Something was happening when the single choice type was set to "number" or "phone number" and custom validation was enabled. I found that either of these worked: * Set the choice type to raw input and keep your regex validation * Set the choice type to phone number and disable regex validation
I'm not sure why this happens, but at least we have a workaround now 😅
have you published your bot recently? The published bot won't update automatically, you need to press the publish button manually every time you want changes to go live. Sort of like having a dev/production setup.
f
Thanks I'm going to try to do it rn
Basically nothing worked so I just gave up on the validation section in the capture card, it doesn't seem to work properly. I solved it instantly by writing simple condition in the Execute code card that sets the variable to undefined if it doesn't match my criteria. An expression card then loops the info capturing node if the phoneNumber variable is undefined. Should have done it earlier, either way thank you, Gordy.
3 Views