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.

Nest IF Statements

Featured Replies

I need to do the following type of logic:

IF AAA = "XXX" AND:

IF B <> "" then X = B

IF C <> "" then X = C

etc.

ENDIF

IF BBB = "XXX" AND:

IF B <> "" then Y = B

IF C <> "" then Y = C

etc.

ENDIF

Is there a good way to nest IF statements? If so, please give an example of the FMP code needed. TIA

I'm assuming you're referring to the If script step and not the If calculation function. If I'm correct, then you want something that looks like

If [AAA = "XXX"]

If [not IsEmpty(:]

Set Field [X; B]

Else If [not IsEmpty©]

Set Field [X; C]

etc.

End If

End If

End If

If you're only setting one field in your nested steps, then you can combine them like

Set Field [X; Case( AAA = "XXX"; Case( not IsEmpty(B); B; not IsEmpty©; C ) )]

If AAA does not equal "XXX", then no result will be returned, nor will there be a result if B, C, etc. are all empty.

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.