App expression for [survey_status] not working as expected

Evening all,

I have an app expression in [survey_status] to force an “Abort” status in certain “No” states.

The Expression Assistant tests as OK but only the “Abort” part of it works in the form.

And, in an “Else” state all of the status buttons are missing in the form.

Any pointers please? :slight_smile:

IF(
OR(
[Enough_Space_For_Cabinet]=“No”,
[Enough_Space_For_HPR]=“No”,
[DB_Q1]=“No”,
[FOSE_Q1]=“No”,
[LPR_Q1]=“No”,
[Jum_Con_Q1]=“No”,
[Enough_Space_For_Cable]=“No”
),
“Aborted”,
SPLIT(
LIST(“Completed”, “In Progress”, “On Hold”, “Aborted”),
“,”
)
)

@Jake_Naude
Below expression should suffice

IF(
	OR(
		[Enough_Space_For_Cabinet]="No",
		[Enough_Space_For_HPR]="No",
		[DB_Q1]="No",
		[FOSE_Q1]="No",
		[LPR_Q1]="No",
		[Jum_Con_Q1]="No",
		[Enough_Space_For_Cable]="No"
	),
	{"Aborted"},
	{"Completed", "In Progress", "On Hold", "Aborted"}
)
1 Like

Thanks @LeventK,

I’ve popped that in and the buttons are back… but they’re all selected…

Capture-list

Please advise if it possible to for the surveyor to select any of the 4 statuses - as long as the “No” condition is not triggered?

Valid If

LIST(
  "Completed",
  "In Progress",
  "On Hold",
  "Aborted"
)

Initial value

IFS(
  OR(
    NOT([DB_Q1]),
    NOT([Enough_Space_For_Cabinet]),
    NOT([Enough_Space_For_Cable]),
    NOT([Enough_Space_For_HPR]),
    NOT([FOSE_Q1]),
    NOT([LPR_Q1]),
    NOT([Jum_Con_Q1])
  ),
    "Aborted"
)
1 Like

Hi @Steve,

Thanks for that… I’m getting an error I don’t understand…?

1 Like

Whoops! I’d assumed the columns were Yes/No values, but it appears not. Replace NOT(...) with ("No" = ...).

Thanks @Steve,

Sorry I wasn’t clear earlier… The columns below are all Enum with “Yes” & “No” values.

I’ve got your expression in the Initial Value and the “Aborted” button is now auto-selecting when a no condition is presented - thanks!

I appreciate that an Initial Value is editable by the surveyor and that this behaviour is as intended for the Initial Value property.

Here’s the big ask…

Is it possible to take this scenario a step further and prevent a surveyor changing that status whilst the “No” condition exists?

:thinking:

IFS(
OR(
[DB_Q1] = “No”,
[Enough_Space_For_Cabinet] = “No”,
[Enough_Space_For_Cable] = “No”,
[Enough_Space_For_HPR] = “No”,
[FOSE_Q1] = “No”,
[LPR_Q1] = “No”,
[Jum_Con_Q1] = “No”
),
“Aborted”
)

Capture-Survey_Status_buttons

Set Editable? to:

NOT(
  AND(
    OR(
      [DB_Q1] = “No”,
      [Enough_Space_For_Cabinet] = “No”,
      [Enough_Space_For_Cable] = “No”,
      [Enough_Space_For_HPR] = “No”,
      [FOSE_Q1] = “No”,
      [LPR_Q1] = “No”,
      [Jum_Con_Q1] = “No”
    ),
    [Survey Status?] = "Aborted"
  )
)
3 Likes

Hey @Steve,

Perfect…!!! That’s the ticket…!!!

Many thanks… :ok_hand:

1 Like