Not saving values from form fields not showing

Sorry if this is a simple question!

I have a form that has a selection Enum like [D], [C], or [V].

When one of those is selected, the subsequent form elements on tabs are either shown or not shown, using Show_if expressions and that all works fine.

The normal value possibilities for those fields are either "Pass" or "Fail" and "Pass" is set as the default. My problem is that I don't want to save anything if it is not shown, so for example, for field [A1], if [D] is selected earlier in the form it shows and then either Pass or Fail is saved to the sheet for cell A1. But if V is selected, I don't show A1 in the form, but it still saves "Pass" to the sheet because that is the default.

What expression can I use and where to not save a value at all when the field is not shown?

thanks

James

Solved Solved
0 7 134
1 ACCEPTED SOLUTION

Please post a screenshot of one of the Show_If expressions.

Please post a screenshot of one of the Initial value expressions.

View solution in original post

7 REPLIES 7

Please try in show_if of [A1]

AND([D], NOT([V]))

Initial value of [A1], please try 

IFS([D], TRUE, [V],"")

[A1],[D], [V] are assumed to be Y/N type fields.

Oh thanks, I'll give that a try.

Hi Suvrutt, this doesn't work.

The field A1 needs to have either PASS, FAIL or be blank. It is only blank if a prior condition, such as column DCV being equal to "D" is met, depending on the situation.

I just get puzzled by how to implement IFS statements, they don't seem like normal programming.

I assume it's something like IFS((DCV)="D", "",(DCV)="C", "PASS",(DCV)="V", "PASS"))

?

 

EDIT

I tried this:

IFS(([DCV]="D"),"",([DCV]="C"),"PASS",([DCV]="V"),"PASS")

but it doesn't work, selecting a DCV value of "C" still leaves the A1 field with neither PASS nor FAIL selected.

Do initial value statements struggle on ENUM fields?

No, Initial value statements do not "struggle" with Enum columns.

Note that the Initial value expression is not evaluated after the row is saved the first time--it's only applied when the row is first created. If you add the row before giving the user the opportunity to edit it in a form, or if the user is re-editing a row they's created previously, Initial value will play no role.

Define App formulas and Initial values - AppSheet Help

 

Thanks Steve.

It doesn't work for me when adding a new row. At the moment, the preselected value for col [DCV] can either be "D", "C" or "V". If for example "D" is selected, the show_ifs work and populate the form with the appropriate questions that follow the "D" selection, on the next tab.

What I also want to be able to do at that stage is not save PASS (the default for all the subsequent columns, currently set by Initial Value) for the ones that aren't relevant to "D" when "D" is selected.

I'm slightly tearing my hair out trying to do this, sigh. I'm probably not quite getting it.

 

Please post a screenshot of one of the Show_If expressions.

Please post a screenshot of one of the Initial value expressions.

Just realised it's case sensitive, Pass is not the same as PASS.

Silly me!

Thanks for your help!

Top Labels in this Space