cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

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
Highlighted
Anonymous
Not applicable

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
Highlighted
Solution Supplier
Solution Supplier

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.

Highlighted
Helper V
Helper V

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.

 

Highlighted
Helper V
Helper V

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

Highlighted
Anonymous
Not applicable

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
Solution Supplier
Solution Supplier

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,198)