You are viewing limited content. For full access, please sign in.

Question

Question

Force a user to select from dropdown in a Single Line field

asked on August 12

Good Morning all,

I have a very complex form with many conditions in it and one of the fields is a Single Line field with auto-suggestions in it. This really should have been a dropdown from the beginning to force the user to select an option, and not be able to type anything in. I tend to not touch the form unless I absolutely have to, so my question is, is there a way we can have a form force the user to select from those auto -suggestions, and not type in the field?

Thank you in advance.

0 0

Replies

replied on August 12

if the auto-suggestions are static and set in the designer (not a lookup), you can use a regular expression. Otherwise your best option is to change to a dropdown and update your process with the new variable

2 0
replied on August 12

Hey Zachary,
They are static (not a lookup), what might that regular expression be?
Thank you.

0 0
replied on August 12

^(apple|banana|cherry)$

Just replace each word with your list of suggestions!

  • ^: This asserts the start of a line. It ensures that the match must begin at the very start of the string.
  • (apple|banana|cherry): This is a grouping with alternation, which means it matches either "apple", "banana", or "cherry".
    • apple, banana, cherry: These are the exact strings that the pattern can match.
    • |: The pipe character serves as an OR operator, allowing for alternatives within the group.
  • $: This asserts the end of a line. It ensures that the match must end at the very end of the string.
0 0
replied on August 12

Thanks Zach, this worked great in little tests. I won't be able to use it however in my regular expression as I can't enter that many characters. I have about 30 selections and it looks like I may restricted to half-ish of that.

Unless you can think of another way, I may just have to just create the new dropdown, change the old variable name to variableOLD and rename the new one to just variable,

0 0
replied on August 13 Show version history

Ah shoot, didn't realize there was a limit there. Dropdown will be your best bet.

I know you don't want to change too much of your form, but if you are able to convert it to the form designer the dropdown allows for typeahead searching of large lists. The conversion creates a copy of the form so you could play around with it in preview mode.

0 0
replied on August 12

If all of the autosuggestions are static, then I would try using the regular expression with the Or feature and listing all of the suggestions.

1 0
replied on August 12

Not with a single line field, unless there's some voodoo way to require it with JS.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.