Hide view when empty?

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!

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

1 Like

Or ISNOTBLANK(TableName[KeyColumn]).

3 Likes

Or that. ^

1 Like

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:

[Make many views do the work of one](https://community.appsheet.com/t/make-many-views-do-the-work-of-one/18405) Tips & Tricks ?

I’m continuing to work on a flashcard app with a view I call “D to W” (definition to word). “D to W” appears to the viewer as one primary view (that is, a view on the bottom menu) but, depending on the circumstances, takes the user to one of the following three views: A deck view of vocabulary cards to study. This is a slice, the contents of which vary from day to day and decrease as the user continues to study. It can empty for one of two reasons – hence the need for the other two views. …

1 Like

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

2 Likes

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.