
Announcements
I am using the following to filter a Gallery; there is also a Combo Box, Checkbox and DatePickers that can be added to the filter using the formula.
Without the checkbox the Gallery shows me ONLY items associated with the choice made in the Combo Box, as desired.
However, as configured, when I check the Checkbox and set the DatePickers the Gallery returns all items on the list that are within the search range rather than ONLY the items within the range that are associated with the content of the Combo Box.
If(ReviewScreenEventDateRangeCheckbox,
Filter(
'Test List',
DateOfEvent>DateAdd(ReviewScreenEventStartDatePicker.SelectedDate,-1,Days)
&&
DateOfEvent<DateAdd(ReviewScreenEventEndDatePicker.SelectedDate,1,Days)
),Sort(
Filter(
'Test List',
Len(ReviewScreenSearchComboBox.Selected.Value) = 0 ||
StartsWith(
Title,
ReviewScreenSearchComboBox.Selected.Value)
),
varSortGallery
))
@Phineas ,
I just spent some time on the same code on this post. The problem here is that you need to specify the outcome you desire when posting large blocks of code, otherwise, the responder will just follow your current logic and put it in a valid format. I have changed the piece you have posted here to get the outcome you desire, but it may not fit in with the much larger piece on the other post mentioned.
Sort(
Filter(
'Test List',
(
!ReviewScreenEventDateRangeCheckbox ||
(
DateOfEvent > DateAdd(ReviewScreenEventStartDatePicker.SelectedDate,-1,Days) &&
DateOfEvent<DateAdd(ReviewScreenEventEndDatePicker.SelectedDate,1,Days)
)
) &&
(
Len(ReviewScreenSearchComboBox.Selected.Value) = 0 ||
StartsWith(
Title,
ReviewScreenSearchComboBox.Selected.Value
)
),
varSortGallery
)
)
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