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

Filter a Gallery based on 2 criteria - one OR the other

I have data displayed in a gallery that has a Status field of Started, Updated, Approved, NeedsMoreInfo. I want the gallery to display only those items that have a status of Started OR Updated. Here is the line that I have for filtering just Started items. How do I make it show Updated as well..

 

Filter(CheckRequest,BudgetManagerEmail=CurrentUserEmail,Status="Started")

 

Many thanks!

Dean

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: Filter a Gallery based on 2 criteria - one OR the other

Hi Dean,

 

If I am correct you want to show Updated aswell. If you want to show them both you use:

Filter(CheckRequest,BudgetManagerEmail=CurrentUserEmail && (Status="Started" || Status="Updated")).

If you want to use the Status Started or Updated you should create a filter. 

 

Hessel

5 REPLIES 5
Anonymous
Not applicable

Re: Filter a Gallery based on 2 criteria - one OR the other

Hi Dean,

 

If I am correct you want to show Updated aswell. If you want to show them both you use:

Filter(CheckRequest,BudgetManagerEmail=CurrentUserEmail && (Status="Started" || Status="Updated")).

If you want to use the Status Started or Updated you should create a filter. 

 

Hessel

Highlighted
deanvirag
Level: Powered On

Re: Filter a Gallery based on 2 criteria - one OR the other

That did the trick!! THanks!!

deanvirag
Level: Powered On

Re: Filter a Gallery based on 2 criteria - one OR the other

So what would the filter look like if I wanted to show just the items created by the person visiting the page? Boy, I struggle with this one....

Anonymous
Not applicable

Re: Filter a Gallery based on 2 criteria - one OR the other

Hi deanvirag, 

 

You can use User().Email for that. So it will be like:

 

Filter(CheckRequest,BudgetManagerEmail=User().Email && (Status="Started" || Status="Updated")).

User().Email is the email of the office365 account. 

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-user

 

Good luck!

Hessel 

deanvirag
Level: Powered On

Re: Filter a Gallery based on 2 criteria - one OR the other

Clarification. As the creator of an item in a list, I want PowerApps to display just the items that I created. I solved it by:

 

1. Added a CreatedByEmail column to the list.

2. In the PowerApps form I autopopulate the field. I set the default value of the CreatedByEmail field to be User().email.

3. On the sreen with the PowerApps gallery, I set up a Context Variable on Screen View to capture email of current user: {UserEmail: User().email} 

4. I then filter the gallery using: Filter(CheckRequest,CreatedByEmail=UserEmail)

 

Thanks for the help!

 

Dean

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

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

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 179 members 5,405 guests
Please welcome our newest community members: