Announcements
The Google Cloud Community will be in read-only from July 16 - July 22 as we migrate to a new platform; refer to this community post for more details.

Only allow certain format in text box in appsheet form

I have a box in a form that needs the user to enter a project number. The project number format is ##-###. Is there anyway to make sure the entry matches this format? I don't want users to put in project numbers that are not the right format.

Solved Solved
0 8 1,422
1 ACCEPTED SOLUTION

Try this:

AND( 
    COUNT(SPLIT([_THIS], "-")) = 2,

LEN(INDEX(SPLIT([_THIS], "-"), 1)) = 2,
OR(INDEX(SPLIT([_THIS], "-"), 1) = "00",
NUMBER(INDEX(SPLIT([_THIS], "-"), 1)) > 0),

LEN(INDEX(SPLIT([_THIS], "-"), 2)) = 3,
OR(INDEX(SPLIT([_THIS], "-"), 2) = "000",
NUMBER(INDEX(SPLIT([_THIS], "-"), 2)) > 0)

One easy way to figure out missing parenthesis is to place the matching closing parenthesis under the function it belongs to.  something like this:

AND( 
    COUNT(
SPLIT([_THIS], "-")
) = 2,

LEN(
INDEX(
SPLIT([_THIS], "-"),
1
)
) = 2,
OR(
INDEX(
SPLIT([_THIS], "-"),
1
) = "00",
NUMBER(
INDEX(
SPLIT([_THIS], "-"),
1
)
?? > 0
),

LEN(
...
)

 

View solution in original post

8 REPLIES 8
Top Labels in this Space