Show_if with CONTEXT()

What would be the best expression for this:

I want a column to show in every view except in form view. But I want to show it in one special form view.

OR(
CONTEXT("View") = "My Special Form View",
IN(CONTEXT("ViewType"), LIST("card","calendar","deck","table","gallery","detail","map","chart","dashboard"))
)

This expression is working. But is there an easier way to do it?

Solved Solved
0 8 5,992
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

A simpler and more efficient expression:

OR(
  (CONTEXT("ViewType") <> "form"),
  (CONTEXT("View") = "My Special Form View")
)

View solution in original post

8 REPLIES 8

There sure is a much easier way to do this: there is a setting under UX>Options and inside the Form section that controls whether the show if expressions are applied universally or only inside the form.
2X_0_0cb88a47617f22bb43a4f1f1e1b15f638561c439.png

The benefit here is that you can put a show if formula of โ€œfalseโ€ on any field and this causes it to be hidden in the form - but show everywhere else. This is because the show if is being enforced only in the form, elsewhere (in all other views) itโ€™s just another column that I can include in the columns shown for a view.

Kudos to you for the use of context() like this, I never thought to try something like that.

@MultiTech_Visions Thank you. But I need the Apply show if universally, because I use it also for other views, like tables.

Thank you for this, I was struggling for so long.... Cheers!

Are you conditionally hiding columns in a table view, or are you meaning youโ€™ve got show if formulas for the entire table view?

I am hiding Columns. For example: Show this column only in the Table View.

Just another example of how there is 4,000 ways to do any 1 thing on AppSheet. (^_^)

Steve
Platinum 4
Platinum 4

A simpler and more efficient expression:

OR(
  (CONTEXT("ViewType") <> "form"),
  (CONTEXT("View") = "My Special Form View")
)

Thank you @Steve. I knew that you would have an easier way

Top Labels in this Space