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 8

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.

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.

 

Highlighted
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 8

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.

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
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Tomorrow, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 286 members 4,962 guests
Please welcome our newest community members: