Skip to main content
Question

How to set a text field that doesn't allow starting/ending with a extra space?

  • April 21, 2020
  • 0 replies
  • 42 views

Hi there, 

How can I set a text field that doesn't allow starting/ending with a extra space?  

When copy and paste, or even manually type in, this text field may contain extra space in the starting and the ending. I found these extra spaces can cause unexpected trouble. How can I to keep the filed type as Text and doesn't allow start/ending extra space? 

Thank you. 

Ning

------------------------------
Ning W
------------------------------
This topic has been closed for replies.

  • Registered
  • April 21, 2020
Ning,
Hey there! Here's what came to mind:

Create a formula checkbox field with the following formula in it:

Left([Text Field], 1) != " " and Right([Text Field], 1) != " "​

That field will be checked only when the text field doesn't end with a space. You can require the formula checkbox field on the record to make sure the text field matches your parameters.

Alternately, you could take your original text field and create a formula field that does the removal of extra space for you.

Trim([Text Field])​

would work for that, if you don't mind using a formula field for all the other interactions.

If you need more help with it, swing by Data Collaborative's free Office Hours, every Thursday at 1pm Eastern.

Sign up here:
https://data.quickbase.com/db/bqeqqj33i



------------------------------
- Sam

______________________________________________
Sam Jones
Vice President, Product and Technology
he/him

The Data Collaborative, Inc.
sjones@datacollaborative.com
366 Massachusetts Ave, Suite 203 | Arlington, MA 02474
------------------------------