IN AND CONTAINS WITH ACTIONS

Hi, I am confused about how to hide an action.

I tried adding the following expressions, at different times, to the Behaviour, Only if this condition is true, section of the editor.

CONTAINS(Batch Number Tracker[Packaging types],"1KG")

IN("1KG",Batch Number Tracker[Packaging types])

I was hoping that one of these would look at the enumlist,base type ref with a "," seperator contained in the column [Packaging types], and see that 1KG is not present and then not show the action on a particular row in the Detail view.

750ml,1Litre,1.5Litre,2Litre,5Litre,20Litre,2.5KG,3.3KG,5KG,20KG

This does not work as I expected as the 1KG action button is still visible even though it is not in the list above. Where am I going wrong?

0 7 73
7 REPLIES 7

You could try:

COUNT(FILTER("Batch Number Tracker", [Packaging types] = "1KG")) > 0.

Hi thanks for the response, I tried this but got the error:

COUNT(FILTER("Batch Number Tracker", [Packaging types] = "1KG")) > 0

Contains() is for text strings, In() is for lists.
Now, why are you using "," as separator? I never touch those, ever. The item separator is by default " , " (with spaces), this may be conflicting somehow but even if it's not, make sure you leave it as default almost ever.

Try this:

IN(
  "1KG",
  SPLIT(
    CONCATENATE(
      Batch Number Tracker[Packaging types]
    ),
    ","
  )
)

Hi, I only put the item separator because it wasn't working. I tried this and it also did not work. I removed the item separator and tried again and still it didn't work.

@SkrOYC I took your expression above and removed the SPLIT CONCATENATE and now it is working. Weird...

Thanks for the assistance.

@SkrOYC actually upon a closer look, it is just hiding all of the options, irrespective if they are in the list or not.

750ml , 1Litre , 1.5Litre , 2Litre , 5Litre , 20Litre , 1KG , 2.5KG , 3.3KG , 5KG , 20KG

I copied and pasted this list from the google sheet cell of the row, where I am trying to manage the action.

And this was my expression.

IN(
"1KG",
Batch Number Tracker[Packaging types]
)

But it did not show up on the Detail view.

So I went back and put your expression in and updated the cell in Appsheet, using the Enumlist option to deselect to create the list 

750ml , 1Litre , 1.5Litre , 2Litre , 5Litre , 20Litre , 2.5KG , 3.3KG , 5KG , 20KG and now the action button is still in place even though 1KG is not in the list. 

I also created a virtual column to pull a List as the actual list is defined on another table and then pulled into the batch number tracker by a dereference and I wasn't sure that the Enumlist was causing the problem but it yieleded the same result where it shows the action even though it is not in the list.

 

 

IN(
  "1KG",
  SPLIT(
    CONCATENATE(
      Batch Number Tracker[Packaging types]
    ),
    " , "
  )
)
Top Labels in this Space