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 161
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