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.

Is Empty for Multiple Fields?

Featured Replies

Hello

I am trying to make a field calculation to show if any of 4 fields are empty the amount of another field should be placed in a field called "Amount Owed"

I had

IsEmpty( AFC, CASH, CHECK, AU):"BUYERSCOST"; "0"

But that is not the way to write it.

Can someone help me with this

the fields that need to show if they are empty are

AFC, CASH, CHECK, AU

Thanks in Advance

STAN

If ( IsEmpty ( AFC ) or IsEmpty ( CASH ) or IsEmpty ( CHECK ) or IsEmpty ( AU );BUYERSCOST;0)

You need to use the IsEmpty for each field separately.

Lynn

Needs to be

If (IsEmpty(AFC) or IsEmpty(CASH) or IsEmpty(CHECK) or IsEmpty(AU), BUYERSCOST, O)

Phil

Amount Owed calculation should be something like.

Case(IsEmpty(AFC), BUYERSCOST, 0,

IsEmpty(CASH), BUYERSCOST, 0,

IsEmpty(CHECK), BUYERSCOST, 0,

IsEmpty(AU), BUYERSCOST, 0)

Another way of handlng this is to recognize that isEmpty(someField) evaluates to 1 if the field is empty. So an alternate way to write this is:

Case( (IsEmpty(AFC) + IsEmpty(CASH) + IsEmpty(CHECK) +IsEmpty(AU) ) > 0, BUYERSCOST, 0)

Or

Case( Sum( (IsEmpty(AFC); IsEmpty(CASH); IsEmpty(CHECK); IsEmpty(AU) ) > 0; BUYERSCOST; 0 )

Any other variations we should offfer? wink.gif

How about:

If(IsEmpty(AFC & CASH & CHECK & AU); BUYERSCOST; 0)

I think this should work without problems (I haven't tested it, tho).

BuyerCost is only used when all fields are empty.

Hope this helps,

Cobra

The request was for BUYERSCOST to be used if any of the fields are empty, not only if all of the fields are empty. So that calculation would solve a different problem.

Whoops! You're right. Sorry about that, I was distracted just before posting a reply.

Some alternatives*:

1. If all your fields are numerical, you can use the following:

If(Evaluate (field1 and field2 and field3 and field4); "All Are Full"; "One Is Empty")

This solution has the added bonus (depending on your POV) of working when one of the fields has 0 (zero) or a space in it.

2. If some of the fields are textual, you can use:

If(Evaluate (IsEmpty(field1) or IsEmpty(field2) or IsEmpty(field3) or IsEmpty(field4) ); "One Is Empty"; "All Are Full")

For solution 2, if a field's value is 0 or a space, the calculation above will consider it to be non-empty.

* you need to un-check "Do not evaluate if all reference fields are empty" for both solutions. IIRC, the Evaluate function is not part of FMP 6 or earlier.

I've tested both solutions and they seem to work without problems in 7.0v2.

Hope this helps!

Create an account or sign in to comment

Important Information

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

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.