Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Setting constraints on a field

Featured Replies

  • Newbies

Hi,

I am somewhat new at using FM6 but not a complete "newbie". I have a field that needs to be exactly 10 digits (no more or less) and the number can start with leading zeroes (ie - 0000123456). I cannot figure out how to set up a field like this. I've tried to do it using calculation but cannot seem to get it to work.

My application has two fields in particular, one is 8 digits and one is 10 digits and my end users occasionally put the 8 digit code in the 10 digit space thus causing some reporting problems.

Anyone done something like this before? confused.gif

Thanks in advance!

If you only have numbers and not spaces or dashes then validate by calculation:

If(Length(number field) = 10,1,0)

Make sure your number format is "Leave Data formatted as entered"

  • Author
  • Newbies

OMG. Thanks so much. I have been banging my head on the desk over this one.

No need for the IF because...

Length(number field) = 10

... will return 1 if true and 0 if false.

In FMP 6 and earlier a number field will strip leading zeros, but a text field will not. I believe this has changed with FMP 7.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.