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 Apps
Answered

Validation dates

(0) ShareShare
ReportReport
Posted on by 93

Hi

 

I have tow column in the list.

- Start date

- End Date

 

I want when the user enter end date less than start date the form should reject and give him message

 

 

Thank you 

Categories:
I have the same question (0)
  • timl Profile Picture
    36,785 Super User 2026 Season 1 on at

    Hi @alhilo 

    Can you see if this answer from @RandyHayes helps?

    https://powerusers.microsoft.com/t5/Building-Power-Apps/End-date-greater-than-start-date/td-p/278399

     

  • ChrisPiasecki Profile Picture
    6,424 Most Valuable Professional on at

    Hi @alhilo,

    You could add the following formula to the field OnChange event:

    If(Not(IsBlank(<endDate>)) And <endDate> < <startDate>, Reset(<endDate>); Notify(<error msg>, NotificationType.Error);)

     

    It will clear the control and show an error notification at top of app. 

     

    ---

    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

     

  • alhilo Profile Picture
    93 on at

    Please note that the code doesn't work

     

    please see the below link

     

    https://ibb.co/bbWtP4v

     

  • ChrisPiasecki Profile Picture
    6,424 Most Valuable Professional on at

    Hi @alhilo,

    Sorry, I should have clarified. Anything with  "< >" are just placeholders. Replace it with the name of your control and Selected Date properly (e.g, EndDateControl.SelectedDate). 

  • alhilo Profile Picture
    93 on at

    Thank you

     

    how I can see the exact name for the control?

     

    e.g the column name is Start date

     

    is the space between start and date will be replaced by any thing? 

  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @alhilo ,

    1)You could check the control name on the left side:

    10142.PNG

    On your picture, you should choose that control and find it here:
    10143.PNG

     

    2)Do you want to :

    if you select data in end date's datepicker earlier than data in start date's datepicker , you will get notification and the form could not be submitted?

    If so, you should set like this:
    set end date datepicker's OnChange:

    If(startdatedatepickername.SelectedDate>=enddatedatepickername.SelectedDate,
     Notify("please do not select date earlier than start date",NotificationType.Warning)
    )
    //please replace with your startdatedatepickername and enddatedatepickername

     

    set SharePointIntegration's OnSave:

    If(startdatedatepickername.SelectedDate<enddatedatepickername.SelectedDate,SubmitForm(SharePointForm1), Notify("select wrong date"))

    10144.PNG

     

     

    Best regards,

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard