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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to set Date Only c...
Power Apps
Unanswered

How to set Date Only column to display only Current date and past date not future date

(0) ShareShare
ReportReport
Posted on by 71

Hi,

 

I have List in SharePoint and in that I have "Request Date" Date only column and I am customizing with PowerApps form.

I need to display on this column Current date by default and user can choose past date only but restriction of choosing the future date that means future date should not be shown.

 

What can be the formula in "InputTextPlaceHolder". Please suggest.

 

 

Categories:
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @MSD52,

     

    I am not aware of a function that hides certain dates within a DatePicker control. However, you could set the DefaultDate to today and show an error message if the date is in the future (and reset the date back to today).

     

    (1) You will have to select the DataCard, go to the property panel on the right, select advanced and select unlock:

    LaurensM_0-1675707969037.png

     

    (2) Set the DefaultDate property of the DatePicker control to:

    Today()

     

    (3) Use the following function in the OnChange property of the DatePicker control:

    If(
     Self.SelectedDate > Today(),
     //Show error message
     Notify(
     "You cannot select a date in the future.",
     NotificationType.Error,
     3000
     );
     //Reset date back to DefaultDate (being today)
     Reset(Self)
    )

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • MSD52 Profile Picture
    71 on at

    Here if I select prior date and save, it is working and future date not accepting but when i edit the saved item with prior date it is sowing current date only for prior date items also.

  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @MSD52,

     

    Ok my apologies. I thought the form was only for creating new records.

    If it is meant for editing records and only if the date is Blank we want to see today's date, we will have to add some conditional logic to the DefaultDate property:

     

    If(
     ThisItem.Date = Blank(),
     Today(),
     //Change DateFieldName to the correct field name that stores the date
     ThisItem.DateFieldName
    )

     You can extend or adjust the If() statement to fit your specific case.

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard