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

Filter Gallery based on Created By and Checkbox

Hi, everyone.

Still fairly new to PowerApps and the filter on my gallery is confounding me. I want to filter the items in the list based on the user. So when Johnny Enduser gets into the app, the Browse screen only shows him his items in the list. That is working fine:

 

Filter('List Name','Created By'.Email=User().Email)

 

Now I want to modify my filter so that it excludes items where the Completed checkbox is true. What's getting me is that my Completed column doesn't always appear in the formula builder. That tells me that I must not be building my formula correctly. How do I build this filter? It's simply called "Completed" and it's a yes/no checkbox. Based on what I've found online, shouldn't I be able to tack onto my existing filter with additional criteria?

 

Filter('List Name','Created By'.Email=User().Email) && If('Completed' = true)

 

Clearly I'm doing something wrong.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Filter Gallery based on Created By and Checkbox

@ACPBSCi 

You can't use a label inside of a gallery as a filter.  You need to filter the Items of the gallery by the name of the column in SharePoint that contains the data. 

View solution in original post

7 REPLIES 7
Highlighted
Super User
Super User

Re: jy

peeking.gif

 

Highlighted
Helper II
Helper II

Re: jy

Yeah, you can't delete once you start. Super annoying.

Highlighted
Super User
Super User

Re: jy

Hi @ACPBSCi 

Welcome back.  

If you put a  label in the gallery and it returns ... true, then your formula should be Filter('List Name','Created By'.Email=User().Email) && 'Completed'=true),   If the label returns yes then you will need to modify the formula. to  Filter('List Name','Created By'.Email=User().Email) && 'Completed'="yes")

Highlighted
Helper II
Helper II

Re: Filter Gallery based on Created By and Checkbox

My label returns true/false. Is there an open paren missing? Should it be:

Filter('List Name','Created By'.Email=User().Email) && ('Completed'="true")

Also, I only want it to show records where Completed = False (or incomplete). So that would be:

Filter('List Name','Created By'.Email=User().Email) && ('Completed'="false")

That doesn't work. It says the name isn't valid, but it's a label I manually added, so I know it is. And the label is displaying the correct values of true/false where appropriate. I have found other discussions where trying to filter on a true/false checkbox is a little gimpy, but people seem to have found success with filtering on false. Since that's what I want to do, I'm hoping it is achievable if I can write my formula correctly. Are there other ways to write it besides the one above?

Highlighted
Super User
Super User

Re: Filter Gallery based on Created By and Checkbox

Try

Filter('List Name','Created By'.Email=User().Email && 'Completed'="false")

Highlighted
Helper II
Helper II

Re: Filter Gallery based on Created By and Checkbox

Filter('List Name','Created By'.Email=User().Email && CompletedLabel="false")

"This rule creates a circular reference between properties, which is not allowed. A property cannot reference itself or other properties affected by its value".

 

Highlighted
Super User
Super User

Re: Filter Gallery based on Created By and Checkbox

@ACPBSCi 

You can't use a label inside of a gallery as a filter.  You need to filter the Items of the gallery by the name of the column in SharePoint that contains the data. 

View solution in original post

Helpful resources

Announcements
secondImage

New Return to Workplace

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

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (5,392)