IF function help

Tom11
New Member

Hello, Sorry to bother the experts with my remedial questions, but I’m struggling with what I think is a simple issue.

I have a column, WarrantOtherJurisdiction that is a simple Enum field type with “YES” or “NO” possible responses. I have set the initial value of the column to be “NO”, as this is a situation that almost never happens. The next column, WarrantJurisdiction is also a Enum field type and list all of the counties in the State of Illinois with the addition of “None” and “IDJJ Parole”.

If WarrantOtherJurisdiction = “NO”, then WarrantJurisdiction should = “None”. If WarrantOtherJurisdication = “YES”, then the user should be able to select one of the Counties in the WarrantJurisdiction list. My expression,

If([WarrantOtherJurisdiction]=“NO”,None," ") within App formula

works correctly to indication “None” when WarrantOtherJurisdiction = “NO”, but does not allow the user to select from the list when WarrantOtherJurisdiction = “YES”. Your assistance is much appreciated!

Thank you!

0 5 160
5 REPLIES 5

Steve
Platinum 4
Platinum 4

Are these options defined as Values in the Type Details of the Enum column? Or do you generate the options in some other way?

3X_0_4_0498f8093ba74cc2bddd4300fe1bf9287cd7d7ab.png

These options are defined as values like the example you provided, I included a snip below:

I hope this helps.

Thanks, that’s what I was looking for.

First off, you won’t be using App formula here. With App formula, the user will never have the option to enter data. Instead, you’ll use Valid If to produce an error if the response isn’t as you allow. Typically, you’d put the Valid If expression on the column that occurs later in the form.

My guess is you want a setup like:

WarrantOtherJurisdiction

  • Required?: ON

  • Initial value: "NO"

WarrantJurisdiction

  • Valid If:

    SWITCH(
      [WarrantOtherJurisdiction],
      "NO", ([_THIS] = "None"),
      "YES", ([_THIS] <> "None"),
      TRUE
    )
    
  • Required?: ON

  • Initial value: IFS(("NO" = [WarrantOtherJurisdiction]), "None")

  • (Optional) Editable?:

    NOT(
      AND(
        ("None" = [_THIS]),
        ("NO" = [WarrantOtherJurisdiction])
      )
    )

While I dont completely understand the SWITCH expression, this solution has done the trick. Thank you!

Top Labels in this Space