Input text fields collect text typed by your users. What if you want to limit the number of characters they can enter? There isn’t a built-in way to do that just yet, but you can achieve something very similar today.
First, you need to associate a formula with the Valid property of your text field to alert your users if they type too much text. The LEN function returns the number of characters in a text string and is perfect for this task. Associate this formula with the Valid property to alert your users if they type more than 20 characters:
This formula won’t help you actually limit the length of the value. What if you want to include only the first 20 characters in a report? Easy, just use a hidden text field using the following formula:
Be sure to reference this hidden text field from your report-generating panel instead of the visible field (which contains all the text typed by your users). Refer to this tip to learn more about using a dedicated panel for generating reports which only contain a select number of fields.
Here’s what the finished app looks like running as a preview in Calcapp Creator:
Do you want to share a tip with other Calcapp users through this blog? Let us know!