Pattern for Data Validity

expressions
(Dan Lawrie) #1

Hi,

I was hoping some one could help me with trying to fugure out how to create a pattern for data validity.

Basically I need the pattern to run with hyphen’s in between numbers at certain points, for example 47-311-87.
I would also like for that pattern to appear as the user is typing, so as they type the first two numbers the first hyphen appears the after the next 3 the last hyphen appears.

Does anyone have any clues, I can not figure out.

(Levent Kulacoglu) #2

@Dan_Lawrie
Unfortunately you cannot have that functionality whilst typing in a field. However, you can format that fields value after the form is saved, with creating an action and assigning it as a Form Saved action.
Another approach could be using the Description property of the column stating that the number shall be entered as xx-xxx-xx and construct a Valid_if expression with:

AND(
	MID([_THIS],3,1)="-",
	MID([_THIS],7,1)="-"
)

You can also specify a meaningful error message with Invalid value error property when user does not enter it in correct syntax that you have specified with Valid_if

(Dan Lawrie) #3

@LeventK,

Thanks for the reply, I have decided to live with plain number, it would of been nice to display it in a more readable format as its being typed and would of given the user that feel of luxury and effort had been put into the making if the app.

Thank you anyway.