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.

Multiple If Statements in Field Definition

Featured Replies

I've been successful in creating a calcuation field with a basic "If Statement." If this, else that. However, I am now trying to create a calculation field that has several criteria.

If this

If this

If this

Else this

However, if I code:

If...

Else If...

Else If...

Else...

As I can in ScriptMaker, I get an error message that the program doesn't recognize the "Else If."

So I guess I'm asking if you can have repeated "If" statements in a field definition and, if so, how?

TIA

In a calculation you need to nest the ifs (or use a Case statement). For example

If(test1;result1;If(test2;Result2;If(test3;Result3;Default)))

or as a Case statement

Case(

test1;Result1;

test2; Result2;

test3;Result3;

Default)

The "case" statement sounds like a good fit.

Slim, you beat-me-to-the-punch.

Looking at the posting times I reckon that's a draw.

If(test1;result1;If(test2;Result2;If(test3;Re sult3;Default)))

Ummm, that is what AND is for

If this AND this AND this ...

I dislike pseudo examples because they never make sense. If you give us your specific need, we can help you with real logic. Otherwise, we're all just guessing here ... :wink2:

LaRetta

If(test1;result1;If(test2;Result2;If(test3;Re sult3;Default)))

Ummm, that is what AND is for

If this AND this AND this ...

I don't think this is a simple AND. In words:

if test1 is true then result1.

If test1 is false and test2 is true then result2

If text1 is false and test2 is false and test3 is true then result3

If test1 is false and test2 is false and test3 is false then default

  • Author

Thanks everyone!

All those replies look great and I'm sure I can get my field to work correctly now...I'll let you know.

In the meantime, if both "If" and "Case" statements will work, why choose one over the other in a formula? I've never been able to understand that.

TIA

Edited by Guest

choose one over the other in a formula?

Iffing is somewhat tighter with only 2 results, while Case( can be almost limitless, in the stacking of conditions. The readability is the main factor when choosing. It's a matter of developers habits I do hardly ever use iffing!!!

--sd

  • Author

OK, wanted to let everyone know I used the "Case" statement and it worked beautifully!

Although I suspect that the "If" statement would have worked equally well.

Sometimes the manual and online help just don't make things clear enough. I'm sure I will have more questions as I work through this solution, but, so far, so good. Thanks so much for your help!

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.