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
Solved! Go to Solution.
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
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