cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
d3ell
Level: Powered On

Filter a gallery excluding certian values

Hi, Im wanting to filter a gallery, but i'm only wanting to show the records that don't have a specific value in a field.

 

ie. i want to see all the records from the list that dont have a "-" in the DevelopmentName Column

 

I'm a bit out of practice as i havent used powerapps for a good few months now, so not sure if i'm being thick and missing something easy!

 

I have tried the following to no avail. - If i remove the "!" then i can only see all the records that contain that, so i'm just wanting to do the opposite!

 

Filter(Developments,Development_Name=!"-")
1 ACCEPTED SOLUTION

Accepted Solutions
shailendra74
Level 10

Re: Filter a gallery excluding certian values

Hi @d3ell 

 

Try below code:

 

ClearCollect(
    collDev,
    Filter(
        Developments,
        !("-" in DevelopmentName)
    )
)

You can set the datasource of gallery to collDev (or just consider from Filter if you do not want collection)

 

Thanks.

View solution in original post

5 REPLIES 5
K-A-R-L
Level 10

Re: Filter a gallery excluding certian values

Hi @d3ell ,

 

Try filtering your gallery with this code:

IsMatch(ThisItem.DevelopmentName, "-",Contains)

----------------------------------------------------------------------------
Thanks,
K-A-R-L


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you thought this post was helpful, please give it a Thumbs Up.

d3ell
Level: Powered On

Re: Filter a gallery excluding certian values

Sorry...

 

I have misworded my initial post Smiley Frustrated I dont have a gallery yet, i meant i'm trying to filter a sharepoint list to create a gallery that doesnt show these items.

 

is there a way to do that? as i'm also wanting to filter the list for a data table as well.

 

d3ell
Level: Powered On

Re: Filter a gallery excluding certian values

The Items fx is currently just "Developments" - This shows all the records from the list in the gallery.

 

If i try to use "Filter(Developments(IsMatch(ThisItem.DevelopmentName, "-",Contains)))

 

It doesnt work

shailendra74
Level 10

Re: Filter a gallery excluding certian values

Hi @d3ell 

 

Try below code:

 

ClearCollect(
    collDev,
    Filter(
        Developments,
        !("-" in DevelopmentName)
    )
)

You can set the datasource of gallery to collDev (or just consider from Filter if you do not want collection)

 

Thanks.

View solution in original post

Highlighted
K-A-R-L
Level 10

Re: Filter a gallery excluding certian values

Hi @d3ell ,

Try adding this code to your gallery Items() Property:

Filter(
    DataSource, //Name of your DataSource
    IsMatch(
        Title,
        "-",
        Contains
    ) <> true
)

or

  Filter(
        AttachmentTest,
       !("-" in Title)
    )

*Note you might have delegation warning but the code will still filter items with "-" on the DevelopmentName Column.

 

----------------------------------------------------------------------------
Thanks,
K-A-R-L


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you thought this post was helpful, please give it a Thumbs Up.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,121)