PowerApps Dropdown Not Displaying Dates How to Display Dates in a Combo Box

PowerApps Dropdown Not Displaying Dates: How to Display Dates in a Combo Box

Introduction

In PowerApps, one may encounter challenges when trying to display date values in a combo box. This article sheds light on this unique behavior and offers effective solutions to address the issue. If you encounter any challenges or require additional technical assistance, feel free to contact us.

The Challenge with Combo Box Control

The combo box control, interestingly, does not inherently support the display of date values. For illustration, consider a SharePoint list named “AvailableDates” with over 2000 records, each containing a title field and a date column termed ‘ViewingDate’. If you integrate this list with a combo box control, the ‘ViewingDate’ column mysteriously disappears and isn’t available for selection.

Alternative 1: Utilizing the Drop Down Control

One possible solution is to leverage the drop down control instead of the combo box. Here, the ‘ViewingDate’ column becomes accessible. However, this approach isn’t free from limitations. First, the drop down control can only accommodate a maximum of 500 rows. So, if a user ventures beyond this number, they’ll be greeted with a “maximum number of items reached” alert. Furthermore, unlike the combo box, the drop down lacks search capabilities, making navigation a tad cumbersome for extensive lists.

Alternative 2: Converting Date Values to Text

The second technique involves converting the date values into text. By employing this method, it’s feasible to configure the combo box control to exhibit up to 2,000 records. But first, ensure the “data row limit” is set to 2000 within the app’s settings.

    ForAll(AvailableDates, 
    {
      DateValue:ViewingDate, 
      DateDisplay:Text(ViewingDate)
    })
    

Reference: ForAll function

This formula generates two columns for every row in the “AvailableDates” list: a ‘DateValue’ column with the original date and a ‘DateDisplay’ column presenting the date’s text representation. Intriguingly, the combo box can showcase the “DateValue” column but will render the date in Unix time. By designating the display fields as “DateDisplay”, the control functions as anticipated, displaying up to 2000 records. For a touch of personalization, you can tweak the formula to format the date distinctly, as demonstrated below:

    ForAll(AvailableDates, 
    {
      DateValue:ViewingDate, 
      DateDisplay:Title & " - " & Text(ViewingDate, "dd mmm yy")
    })
    

Conclusion

Displaying date values in a PowerApps combo box might present a hurdle, but with the right techniques, it’s a surmountable challenge. Converting date values to text offers a practical workaround, allowing for effective integration and display within the combo box. Should you need further assistance or clarification on this topic, or any other technical matter, do not hesitate to contact us. Our team is always ready to assist!

About The Author