Jump 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.

Data Validation

Featured Replies

I would like to perform record validation when the user commits a record. For example, if the value of a boolean field = True, I would like to ensure that another field in the same record is empty. How do I do this?

You could use this validation, James, attached to your second field:

IsEmpty(SecondField) and Boolean > 0 or Boolean < 1

Unclick 'Validate Only if Field has been Modified' in the calculation box. Oh. I know there are prettier, more clever ways. I just can't think of them. wink.gif

LaRetta

  • Author

Post deleted by James McIlwrath

Something is askew then. Attached is my file. smile.gif

boolean.zip

  • Author

No, you were absolutely correct. I'm new to FileMaker and I just didn't understand your approach. Thanks for your attached file. It quickly cleared everything up. Actually, I wanted to ensure that the second field is empty if the boolean field is equal to "Yes" and not empty if the boolean field is equal to "No". Following your example, here is the calculation that acheives this when used as validation for the second field:

IsEmpty(secondfield) and boolean = "Yes" or not IsEmpty(secondfield) and boolean = "No"

Thanks very much.

Hi James,

I wondered what would be the criteria if the boolean was false - whether you would allow it to remain blank. And FM7 does not treat Yes/No, True/False, T/F, or Y/N as booleans like prior versions did. I thought you meant 'real' booleans.

Regardless, I'm pleased you have it working for you now. smile.gif

LaRetta

This is where xor comes in handy, too.

IsEmpty(secondfield) xor boolean = "No"

XOR ensures only one statement can be true, but not both. So it implies the inverse.

  • Author

Yes, of course. Even better!

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.