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 / SharePoint List Forms ...
Power Apps
Answered

SharePoint List Forms Date Checking on Save

(0) ShareShare
ReportReport
Posted on by

Newbie here.

 

I have a SharePoint List Form that I'm editing in PowerApps. There are 2 date/time fields ("Start" & "End") in my SharePoint list. I want to do a bit of error checking to see if Start is after End. If Start is after End, I want an error message to appear when the user hits "Save" on the form since Start should not be after End.

 

Based on my research, I need to edit OnSave in SharePointIntegration.  Here's what I've tried (among many other things):

 

ben94607_4-1600731472259.png

 

PowerApps does not detect a syntax error in the code, but the code does not work since it does not detect when Start is after End. 

 

My SharePoint List has the date/time fields "Start" and "End." My PowerApps form has these cards:

ben94607_3-1600731203071.png & ben94607_2-1600731161131.png

 

Any ideas? Thank you for your help!

 

-Ben

Categories:
  • Verified answer
    eka24 Profile Picture
    20,925 on at

    Since the validation is occurring on App, change the start and end to;

    If(

    DateValue1.SelectedDate>

    DateValue2.SelectedDate,Notify(.….))

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Verified answer
    KrishnaV Profile Picture
    5,023 on at

    Hi @ben94607 ,

     

    try this:

    If(DateDiff(DateValue2.SelectedDate,DateValue1.SelectedDate,Days)>0,SubmitForm(SharePointForm1),Notify("End Date can't be less then the start date"))

     

  • BW-01101641-0 Profile Picture
    on at

    Thank you. That works well. Is there a way to incorporate the time in there also so that it compares both date & time? 

  • KrishnaV Profile Picture
    5,023 on at

    Unfortunately no! if that helps your issue please mark it as a solution so that the new members will make use of it.

  • eka24 Profile Picture
    20,925 on at

    What will be the purpose of the time?

    Is time not part of your date already

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

     

  • KrishnaV Profile Picture
    5,023 on at


    I just want to follow up with you on this issue to see is it resolved or still you see any challenges.

    If you see any challenge/need further help let me know I am always happy to help

  • BW-01101641-0 Profile Picture
    on at

    The form is a leave request form. It's important to see if the start date & time is later than the end date & time. I thought of having a nested if statement to first test for date and then time, but I was hoping for something more straight forward. 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 337 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 250

#3
Mohsin Ali Profile Picture

Mohsin Ali 225

Last 30 days Overall leaderboard