How to control what is written in the form field?

Hello to all! Just want to apologize for my English using Google translator. The essence of my question is the following. There is a form with the "Serial numbers" field, in which the user must enter force values ​​separated by commas, for example "23432, 38543, 71234". Is it possible for Appsheet to validate this field for "correct input"? So that the user writes exactly the correct serial numbers, and not some random characters, just to finish editing faster. Or maybe there is some hidden way to organize the recording of serial numbers in a more user-friendly way?

Solved Solved
0 3 121
1 ACCEPTED SOLUTION

There’s more than one way. I would do the following:

- put the valid serial numbers in a new table. Lets name it Serials. The key is for example: serialID. 
- in the table of your form, you have a column Serial Numbers. This column should be of type: EnumList, with element type set to Ref, and it should reference the Serials table. 
- Then you put this expression in the  Suggested_Values field of this column: Serials[serialID]

Here the user will have the list of valid serial numbers and he will have to just click on the desired ones. 
Additionally you can put this expression in the Valid_If field: IN([_THIS], Serials[serialID])

View solution in original post

3 REPLIES 3

There’s more than one way. I would do the following:

- put the valid serial numbers in a new table. Lets name it Serials. The key is for example: serialID. 
- in the table of your form, you have a column Serial Numbers. This column should be of type: EnumList, with element type set to Ref, and it should reference the Serials table. 
- Then you put this expression in the  Suggested_Values field of this column: Serials[serialID]

Here the user will have the list of valid serial numbers and he will have to just click on the desired ones. 
Additionally you can put this expression in the Valid_If field: IN([_THIS], Serials[serialID])

This is probably a good one to try. Thanks for the idea! But wouldn't thousands of lines of serial numbers affect the performance and speed of application synchronization?

 

Maybe someone else can give me a good way?

Welcome. I’d say no. Experts here have been recommending the use of IN()  for the very reason of performance and the Expression Assistant wouldn’t give you a warning about it as opposed to for example a SELECT. 

Also, if your data can be meaningfully filtered, for example you know that for some cases, only a subset of Serial numbers are possible, not all of them, then you can have your list pre-filtered using a Slice, and have much less valid values for the user to choose from through the Slice. 

Top Labels in this Space