Qs about User Input Management
# 🤝help
l
Hi, just wondering, is there a way to restrict a user input? For example, If I were to place a "Single Choice" capture information card, can we prevent users from writing instead of selecting from given choices? Another question is, can we prevent users to enter "-" when entering their phone numbers when I put "Phone Number" Capture Information card?
w
One approach to consider is mapping the user input to a variable, then running a sanitizing / cleaning process on it (regex, etc) in an
Execute Code
card. (one could also run such a process on
event.preview
itself which is the raw user input, but I think operating on a variable to which it's mapped is cleaner)
l
Is there a video tutorial on this? I don't think I am quite following 😦
w
I'm not sure -- might be worth checking out BP's YouTube channel -- with regard to mapping user input to a variable, there are lots of ways to do it -- after creating the variable, you could use an
Execute code
card to bind the value of
event.preview
to that variable, or you could use an input card (such as
Raw input
) that has the variable binding functionality built-in
l
Let me try, thank you for your help!