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 / date validation using ...
Power Apps
Answered

date validation using if condition

(0) ShareShare
ReportReport
Posted on by 14

hello experts, i have one label in my app. i want it to be visible only if the selected date form other field is less than 12/15/2022. how can i make it?

Categories:
  • Verified answer
    CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @PrabhuRajaram ,

    Set Visible property of the label to:

    DatePicker.SelectedDate<DateValue(“12/15/2022”)

  • MM-25111418-0 Profile Picture
    on at

    Hi @PrabhuRajaram 

     

    I have used the function "DateDiff" to check if the date is within a certain range. If I understood you correct you want to show a label when the date is between today and 15.december 2022? If so you could try out this:

     

    Skjermbilde.PNGSkjermbilde2.PNG

    Image to the left is the text that is showed when the user is choosing a date before 15.december 2022 or choosing exactly that date. If the user chooses a date after 15.december 2022 the image to the right will be shown. The code that is used:

     

    If(DateDiff(DatePicker1.SelectedDate;Date(2022;12;15)) >= 0;"Label is visible before 15.december";"Label vil not show")

     

    What the code does is that it checks how mane dates/days it is between the selected date and a manually inserted date. If the output number is before or is number zero then the condition is true. Else it will return the false statement. 

     

    Use this code on the Text-property of the label you want the condition to be checked in. 

    If you dont want any text in the label if the date condition is true or false you can just remove the text between the "". 

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 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard