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 / Current or Modern Date...
Power Apps
Unanswered

Current or Modern Date Picker: Limit Date Picker Options Based on Days Selected

(0) ShareShare
ReportReport
Posted on by 232

Hello All,

 

I have an app that has a combo box with the days of the week as selection options (ex. Sunday, Monday, Tuesday....). This is a multiselect combo box. I have a couple of questions.

 

  1. Is there a way to make the date picker only allow dates to be selected based off of the combo box selection? EX. ComboBox1 = Tuesday and Thursday. The date picker will only allow dates that fall on Tuesday and Thursday to be selected.
  2. Is there a way to do this with the modern date picker? It is so nice to just click that date and it populates. In the regular date picker we have to select the date and click "Okay".
  3. Also is there a way to make the calendar only allow the selection of dates that are current or in the future? No selecting dates before the current date.

Any assistance is greatly apperciated.

 

Collin Kogut

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @collinktx ,

     

    I've made a test for your reference(Modern Date Picker):
    1\Set the combobox(ComboBox1)'s items property to:

     

    Table(
     {Value:"Sunday",ID:1},
     {Value:"Monday",ID:2},
     {Value:"Tuesday",ID:3},
     {Value:"Wednesday",ID:4},
     {Value:"Thursday",ID:5},
     {Value:"Friday",ID:6},
     {Value:"Saturday",ID:7}
    )

     

    2\Set the Modern Date Picker's OnChange property to:

     

    If(
     !(Weekday(Self.Value) in ComboBox1.SelectedItems.ID),
     Reset(Self);Notify("The weeknum of the date you selected is not allowed!")
    )

     

     

    Best Regards,

    Bof

  • collinktx Profile Picture
    232 on at

    Hello @v-bofeng-msft ,

     

    This works perfectly. Thank you so much. I did have 2 other questions pop into my head. 

     

    1. Can I add something to the date picker that would not allow the user to select a date before the current date on the modern picker? So today is August 2, 2023 and the user tries to select July 30, 2023. Ths would not be allowed. 
    2. I noticed when I set the Modern Date Picker to DisplayMode = View it becomes transparent and I cannot read the selected date very well. I just put a white rectangle shape behind the date picker to give it the idea you could see it. Any ideas that would work better for showing the date picker information? The image below shows what I mean. 

    Regular/Current Box                        Modern Date Picker              Modern Date Picker with white Rectangle below it.

    2023-08-01_23-23-05.png

     

    Thanks again!

     

    Collin Kogut

  • collinktx Profile Picture
    232 on at

    Hi @v-bofeng-msft ,

     

    I ran into an issue with this solution you gave me and was hoping you might be able to help. I discovered that the combobox(ComboBox1) with the table values does not return the multiple days to my sharepoint. It only returns the last day selected. Before I got your solution for my issue I was pulling the days from a different sharepoint with all my dropdown data. The update field for the datacard that holds the combobox is set to combobox1.selecteditems. Is there a way to set this up to update my sharepoint with all days selected in the combobox?

     

    Thanks,

     

    Collin Kogut

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard