Allow only specific entry in the form

Hi,

How can allow only specific entry in the form. The first four numbers are the same. like this tracking no

4677******

2322*****

1266*******

SF34******

Take a look at the following article in the help documentation.

|


| Valid_If Column Constraint |
| - | - |
| | How to check if a given form input is valid based on its type. |

You can use the left() function to ensure the entry starts with the correct four characters:

left([tracking_no], 4) = "SF34"

You could also use the startswith() function:

startswith([tracking_no], "SF34")

if you need to check for multiple allowed prefixes, then you can use or():

or(
  startswith([tracking_no], "SF34"),
  startswith([tracking_no], "1266")
)

if you had a longer list of allowed prefixes, then you could use the in() function along with a list:

in(
  left([tracking_no], 4),
  {"4677", "2322", "1266", "SF34"}
)
1 Like