web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / ComboBox with sequence...
Power Apps
Unanswered

ComboBox with sequence of dates

(0) ShareShare
ReportReport
Posted on by 5,836 Moderator

I have a collection of dates in a canvas app.  (No forms involved,) currently dispayed in a dropdown, that I need to display in a combobox.   These are all Fridays and are set dynamically using the following formulas:

 

varFirst Friday:

 

 

Set(varFirstFriday, Text(DateAdd( DateValue("1" & "/" & "1" & "/" & Year(Today())), (6- Weekday(DateValue("1" & "/" & "1" & "/" & Year(Today())))))))

 

 

And I can set the dropdown to this or I can create a collection and display it in a gallery.

 

 

Filter(

ForAll(Sequence(52, Value(Trim(Last(FirstN(Split(varFirstFriday, "/"), 2)).Result)), 7), Date(Year(Today()), 1, Value)), (Trim(Last(FirstN(Split(Text(Value), "/"), 3)).Result)) = Text(Year(Today()))

) 

 

 

 

 

 

ClearCollect(Fridays, ForAll(Sequence(52, Value(Trim(Last(FirstN(Split(varFirstFriday, "/"), 2)).Result)), 7), Date(Year(Today()), 1, Value)))

 

 

 

Those work nicely.    If I try to display it in a combobox, using the formula or the collection I get this instead of a nicely formatted list of dates.   I can't select the Value from the ComboBox data pane so the items property is Fridays.Value

 

comboboxdates.png

 

Any ideas or suggestions for having it display in the correct format would be most appreciated.

Categories:
I have the same question (0)
  • Verified answer
    timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    Hi @JR-BejeweledOne 

    It looks like the combobox control cannot display date values properly.

    To work around this, you could add a field that contains the text equivalent of the date value.

    ClearCollect(Fridays, 
     ForAll(Sequence(52, 
     Value(Trim(Last(FirstN(Split(varFirstFriday, "/"), 2)).Result)), 7), 
     {
     DateValue:Date(Year(Today()), 1, Value), 
     DateDisplay:Text(Date(Year(Today()), 1, Value))
     }
    ))

    This would produce this:

    timl_0-1625255286391.png

    You can then set your combobox to display the "DateDisplay" field and if you need to retrieve the actual date value, you can reference the "DateValue" field (eg ComboBox1.Selected.DateValue).

     

    You could also pass a format string in the call to the Text function when you build "DateDisplay", if you want to format the display date in a specific way.

     

  • Mace Profile Picture
    41 on at

    Hi @JR-BejeweledOne,
    I just had a similar issue with values from a date column in my database. I formatted the data displayed in the ComboBox by using the following formula for the ComboBox's "Items" parameter:

    Distinct(Sort(DataSource.DateColumn,DateColumn),Text(DateColumn,"[$-en-US]dd/mm/yyyy")).Result

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard