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

When combo box is blank, not returning all results

I am building an app to track license status. I created a collection to pass through to a combobox that will filter by upcoming expirations in the next week and next month. However, when my combo box is empty it only shows me licenses with blank date values instead of all licenses in the database. I assume it is the structure of my formula. Can someone help me?

Here's the code I am using: 

Filter(
'License Tracker',
StartsWith(State, Searchbox.Text) || StartsWith('License Holder'.Value, Searchbox.Text),
'Expiration Date' >= ddTimeSelection.Selected.StartDate && 'Expiration Date' <= ddTimeSelection.Selected.EndDate && If(!IsBlank(ddTimeSelection.SelectedItems), 'Expiration Date'
))

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @sjones11922 ,

The syntax you need would be something like this, but how are you selecting both the start and end date from the one dropdown?

Filter(
   'License Tracker',
   (
      StartsWith(
         State, 
         Searchbox.Text
      ) || 
      StartsWith(
         'License Holder'.Value, 
         Searchbox.Text
      )
   ) &&
   (
      Value(ddTimeSelection.Selected.StartDate)=0 || 
      (
         'Expiration Date' >= ddTimeSelection.Selected.StartDate && 
         'Expiration Date' <= ddTimeSelection.Selected.EndDate 
      )
   )
)

 

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.

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @sjones11922 ,

The syntax you need would be something like this, but how are you selecting both the start and end date from the one dropdown?

Filter(
   'License Tracker',
   (
      StartsWith(
         State, 
         Searchbox.Text
      ) || 
      StartsWith(
         'License Holder'.Value, 
         Searchbox.Text
      )
   ) &&
   (
      Value(ddTimeSelection.Selected.StartDate)=0 || 
      (
         'Expiration Date' >= ddTimeSelection.Selected.StartDate && 
         'Expiration Date' <= ddTimeSelection.Selected.EndDate 
      )
   )
)

 

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.

View solution in original post

Thank you so much! This worked. My combo box has the choices "This week" and "This month" and I is based on a collection on the OnVisible of my home screen: 

ClearCollect(
colTimeFilter,
{
DisplayName: "This Week",
StartDate: DateAdd(
Today(),
1 - Weekday(
Today(),
StartOfWeek.Monday
),
Days
),
EndDate: DateAdd(
Today(),
1 - Weekday(
Today(),
StartOfWeek.Monday
) + 6,
Days
)
},
{
DisplayName: "This Month",
StartDate: DateAdd(
Today(),
1 - Weekday(
Today(),
StartOfWeek.Monday
),
Days
),
EndDate: DateAdd(
Today(),
1 - Weekday(
Today(),
StartOfWeek.Monday
) + 30,
Days
)
}
)

Hi @sjones11922 ,

This is solved now? If so please mark as solution.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,273)