cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Thanapat_Tai
Frequent Visitor

Filter gallery multiple Filter with the press of a button.

Hello

I have a question about filter my gallery
I have created 4 receivers when I put any one of these 4 values and press the button. it filter the gallery accordingly

Now I'm issue when I just put one value and press the button. my gallery not filter and gallery not show data.


This my code :
If(IsBlank(vFilterStatus) And IsBlank(vFilterBudget) And IsBlank(vFilterFromDate) And IsBlank(vFilterToDate),
PRHeader,
Filter(PRHeader,
If(!IsBlank(vFilterBudget),Budget = vFilterBudget),
If(!IsBlank(vFilterFromDate) And !IsBlank(vFilterToDate),'Document Date' <= vFilterFromDate And 'Document Date' >= vFilterToDate),
If(!IsBlank(vFilterStatus),Status = vFilterStatus)
)
)

values in each of my variables
vFilterStatus   = "R"
vFilterBudget , vFilterFromDate  , vFilterToDate   = Blank

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Thanapat_Tai ,

I assume you do not want the date filter unless both of them are present

Filter(
   PRHeader,
   (!IsBlank(vFilterBudget) || Budget = vFilterBudget) &&
   (
      (!IsBlank(vFilterFromDate) && !IsBlank(vFilterToDate)) ||
      ('Document Date' <= vFilterFromDate && 'Document Date' >= vFilterToDate)
   ) &&
   (!IsBlank(vFilterStatus) || Status = vFilterStatus)
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @Thanapat_Tai ,

I assume you do not want the date filter unless both of them are present

Filter(
   PRHeader,
   (!IsBlank(vFilterBudget) || Budget = vFilterBudget) &&
   (
      (!IsBlank(vFilterFromDate) && !IsBlank(vFilterToDate)) ||
      ('Document Date' <= vFilterFromDate && 'Document Date' >= vFilterToDate)
   ) &&
   (!IsBlank(vFilterStatus) || Status = vFilterStatus)
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

thank you very much@WarrenBelz 

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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