Hide view when empty?

jwong
New Member

Hello!

I would like to hide one of my views from the bottom bar when the associated slice is empty (which it should be most of the time).

I know i need to use a formula in display options but i am not sure how to write it.

Thanks!

0 9 1,472
9 REPLIES 9

Bahbus
New Member

Show If: COUNT(TableName[KeyColumn])>0

Or ISNOTBLANK(TableName[KeyColumn]).

Simplicity at its finest.
I have been scouring the AppSheet community for this answer believing that it was gonna be some long drawn out code

3X_b_5_b5d0e2051c114b6feb26dbf4f7ac6362a465002d.gif

Bahbus
New Member

Or that. ^

What I do is a variation on what has been pointed to by @Bahbus and @Steve. I make a separate view to tell the user that the view has no data (which makes sense in my app). Iโ€™ve described my approach here:

I attempted both @Bahbus and @Steve responses in the Show If option within View-->Display. AppSheet only accepted the @Steve formula (green check mark), but it did not have the desired effect. It is to say, the table that is contained in a particular View, when empty, continues to be visible within the Dashboard in which it's contained.

Does that explanation make sense? Does anyone have any insights here? Thank you in advance!

Mike

The original request was to hide the view from the bottom menu bar and that is where Show If comes in. I don't believe there is a mechanism to conditionally include a view in a dash board, I would imagine you would need to create two dashboards and then use the Show If expression on those to determine which is shown.

Okay, thanks @graham_howe !

Hey @mschaef8,

You can achieve this without making two dashboards, I currently have multiple views in a dashboard that show if empty or contain data. By default, the view should still appear even if the table is empty.

You can also show the same view with slightly different data by copying your view, setting the new one to a slightly different slice of the same data, include it in your dashboard and then use a show_if to hide or show under certain conditions.

Top Labels in this Space