cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AshROC
Helper I
Helper I

How do I hide gallery items if the Gallery label has a specific value

Hello 😄

 

I need help with the gallery.

I would like to hide the gallery items if the gallery label contain a specific value. (In this case its "Y")

The catch is that the label result is based on another table.

 

Gallery: SortByColumns(Search(RDR1,Search_Certifications_5.SEARCH_Value,"U_WR_OTHER","ItemCode","Dscription"), "DocEntry" ,Descending) 

 

Label1_26: LookUp(RDR2, ItemCode = ThisItem.ItemCode).QryGroup7

 

The label only gives result of "Y" or "N".

 

I really need your help please 🙂

Thank you!

10 REPLIES 10
Gochix
Solution Sage
Solution Sage

Hi @AshROC ,

 

You can try :

With(
    {
        RemoveItems: LookUp(
            RDR2,
            Not(QryGroup7 = "Y"), //assuming that QryGroup7 contains "Y" and "N"
            ItemCode
        )
    },
    SortByColumns(
        Search(
            Filter(
                RDR1,
                ItemCode in RemoveItems
            ),
            TextInput1.Text,
            "ItemCode"
        ),
        "ItemCode",
        Descending
    )
)


_____________________________________________________________________________________
Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

AshROC
Helper I
Helper I

Hmmm

 

Hmmm, it seems to only give me 1 item instead of 2. as there are 2 items with the QryGroup = "Y".

 

I used this. 

 

With(
{
RemoveItems: LookUp(
RDR2,
Not(QryGroup7 = "N"), //assuming that QryGroup7 contains "Y" and "N"
ItemCode
)
},


SortByColumns(Search(Filter(RDR1,ItemCode = RemoveItems),Search_Certifications_5.SEARCH_Value,"U_WR_OTHER","ItemCode","Dscription"), "DocEntry" ,Descending))

 

 

Picture attached is 1 = After. 2 = Before

Ouh! I noticed the Lookup for that "RemoveItems" variable is for the first item it captures. Unfortunately i have multiple items with the "Y" 🙂

Good point.

Then change the lookup function to filter function.

With that you will be able to filter through all RDR2 QryGroup7 = "Y" items.


_____________________________________________________________________________________
Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

Okay, ive changed to filter,

 

With(
{
RemoveItems: Filter(
OITM,
Not(QryGroup7 = "N"), //assuming that QryGroup7 contains "Y" and "N"
ItemCode
)
},


SortByColumns(Search(Filter(RDR1,ItemCode = RemoveItems),Search_Certifications_5.SEARCH_Value,"U_WR_OTHER","ItemCode","Dscription"), "DocEntry" ,Descending))

 

Mmmm... but im faced with this issue...It says

"Incompatible types for comparison. These type cant be compared: Text, Table"

You are trying to compare the ItemCode with the whole table of RemoveItems that’s why there is an error. 

please try:

With(
    {
        RemoveItems: Filter(
            RDR2,
            QryGroup7 = "Y"
        )
    },
    SortByColumns(
        Search(
            Filter(
                RDR1,
                ItemCode in RemoveItems.ItemCode
            ),
            TextInput1.Text,
            "ItemCode"
        ),
        "ItemCode",
        Descending
    )
)


_____________________________________________________________________________________
Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

 

Dear Gochix, I think we are close to solving it! 😄 but erm...i think it has some delegation issue...

It says the Highlighted part of this formula might not work correctly on large data sets.

The highlighted part is "in" from the 

 

SortByColumns(Search(Filter(RDR1,ItemCode in RemoveItems.ItemCode), Search_Certifications_5.SEARCH_Value,"U_WR_OTHER","ItemCode","Dscription"), "DocEntry" ,Descending))

Hi,

have you tried to change the “in” to “=“?

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,933)