Enum List compared to text and other questions

Hello,

I am working on my first project and have a couple questions about formulas and design UI.

First I have an ENUM column that is used for filtering in a Dashboard. I need to compare this to a text for the filtering. Currently I am using the CONTAINS() function which works except for one case where two items contain the same two letters. (IE. “DP” and “DPS”). I need to be able to match the exact text so that DPS is not filtered out when I want to filter out DP only.

I am also using a few in(CONTEXT(“View”)) functions and was trying to figure out if this could also be used for sub views inside a dashboard few. Can I filter data to a specific sub view of the dashboard via a formula like this using a selection form?

for IN(CONTEXT(“Host”)) function what are the handles for a desktop browser vs mobile browser/app? and can this be used to change the displayed bottom menu items depending on the host used?

In my form selection form for the dashboard filtering. Is there a way to make the different columns reset to blank if the active filter column is blank? And is there also a way to make all the filter reset to blank when the app is launched/synced?

So you have a slice also? What are the problems you are running into when making this exactly? Please share your entire setup to understand what you are doing.

No. CONTEXT(ViewType/View) is always your Dashboard view, not the views inside of it

Idk why you mention the IN() expression exactly. About the CONTEXT(“Host”), the docs are very clear IMO:

SkrOYC_0-1660842202519.png

Why are you using a Form? How are you using it? You can’t reset to blank by listening to a certain column value, just by using actions and those don’t work on Form Views. You can’t execute actions on sync, although you may want to vote for a feature idea about it.

Are you sure you are using a Form?
Also, you came up with the idea of this Dashboard or did you see a video or something and followed through? I suggest you to read the docs before doing AppSheet Apps

AppSheet Help
1 Like

Thanks for replying!

Part 1:
Actually the formula that I am having the issues with isn’t part of the slice filter. It a Show_IF for the View inside the dashboard. Here is the formula:

IF(
AND(CONTAINS(Catalog Filter[Active Filter],“Rarity”),NOT(CONTAINS(Catalog Filter[Brand Filter],“D&D”)),ISNOTBLANK(Catalog Filter[Brand Filter]),ISNOTBLANK(Catalog Filter[Rarity Filter])),
IF(
CONTAINS(Catalog Filter[Rarity Filter],“Starter”),
FALSE,TRUE),

IF(
AND(CONTAINS(Catalog Filter[Active Filter],“Set”),ISNOTBLANK(Catalog Filter[Brand Filter]),ISNOTBLANK(Catalog Filter[Set Filter])),
IF(
OR(
CONTAINS(Catalog Filter[Set Filter],“DP”),
CONTAINS(Catalog Filter[Set Filter],“GOTG”),
CONTAINS(Catalog Filter[Set Filter],“XMFC”),
CONTAINS(Catalog Filter[Set Filter],“GAF”),
CONTAINS(Catalog Filter[Set Filter],“BAT”)),
FALSE,TRUE),FALSE))

It works how I want it to, except it returns FALSE on rows that have a [Set Filter] of DPS where it should be only DP.

I fixed this issue by changing the line

CONTAINS(Catalog Filter[Set Filter],“DP”),

to

AND(CONTAINS(Catalog Filter[Set Filter],“DP”),NOT(CONTAINS(Catalog Filter[Set Filter],“DPS”))),

but I can’t find is there is a better way to make this.

Part 3:
I am wondering if I can make a Show_IF express that changes that bottom row menu and side menu link based on if I am in Desktop or Mobile view. I wasn’t sure if there was a difference between desktop browser and mobile browser as far as host is concerned.

Part 4: No sorry, it is a Detail View with quick edit columns. I have the Dashboard setup and working now. It contains 11 views based on 11 different slices. And using Show_IF expressions and nested IF expressions in the slices filter expression I was able to filter in and out several view options based on different selections in the detail view. I also made some actions to clear the columns as a work around.

New:

I have a gallery view and table that acts as a menu for my app. Is there a way to conditionally pass the detail view a display name based on the column value of the row selected in the gallery view?

On the very last part, I should mention that I am using a LINKTOFILTERVIEW() to navigate the menu and submenus and to to specific detail views. I just wondered if there was a way to make the detail view be conditional based on a value I can link to it.

I just started to read your comment and I noticed a problem with your expressions.

Do not use:
CONTAINS(Catalog Filter[Active Filter],“Rarity”)

Instead:

IN(
 "Rarity",
 Catalog Filter[Active Filter]
)

Or:

ANY(Catalog Filter[Active Filter])="Rarity"

Or:

INDEX(Catalog Filter[Active Filter], 1)="Rarity"
2 Likes

Thanks again for the feedback. Based on your suggestion I used the IN() function and replaced the CONTAINS() and realized I can rework it better. It works now just as it intended and looks cleaner!

IF( 
AND(
  IN("Rarity",Catalog Filter[Active Filter]),
  NOT(IN("D&D",Catalog Filter[Brand Filter])),
  ISNOTBLANK(Catalog Filter[Brand Filter]),
  ISNOTBLANK(Catalog Filter[Rarity Filter]),
  NOT(IN("Starter/BAC",Catalog Filter[Rarity Filter]))),
     TRUE,
  IF(
  AND(
    IN("Set",Catalog Filter[Active Filter]),
    ISNOTBLANK(Catalog Filter[Brand Filter]),
    ISNOTBLANK(Catalog Filter[Set Filter]),
    NOT(IN("DP", Catalog Filter[Set Filter])),
    NOT(IN("GOTG",Catalog Filter[Set Filter])),
    NOT(IN("XMFC",Catalog Filter[Set Filter])),
    NOT(IN("GAF",Catalog Filter[Set Filter])),
    NOT(IN("BAT",Catalog Filter[Set Filter]))),
  	TRUE,FALSE))
1 Like