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 / User timesheet control...
Power Apps
Unanswered

User timesheet control the max value

(0) ShareShare
ReportReport
Posted on by 22

Hi Power Apps Community 

 

I am trying to make at timesheet app. I am useing sharepoint as data. I am useing Text(CurrentDateTime,"[$-en-US]ddd dd-mm-yyyy hh:mm:ss") to get the time in at datacard (sharepoint) .  The problem is that I need to make it so a day max can be 10 hours. 

 

 

Thanks  

Categories:
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @mip96 ,

     

    Do you want to limit the end time selection of less than 10 hour from the start time?

     

    If you do, I’m afraid there is no way to achieve your goal currently in PowerApps. But you could create an Hour Validation on your submit button. Below is my demo:

    time validation.gif

     

    Below is the formula of the Label’s Text, you could set it invisible in your app just for checking the result of If statement, and you could also use two variables to store those two time value so that you would be able to patch them to data source more conveniently.

     

    Set(varST,Text(Concatenate(Text(DatePicker2.SelectedDate)," ",Dropdown1.Selected.Value,":",Dropdown7.Selected.Value),"[$-en-US]mm/dd/yyyy hh:mm:ss"));
    Set(varET,Text(Concatenate(Text(DatePicker2_1.SelectedDate)," ",Dropdown1_1.Selected.Value,":",Dropdown7_1.Selected.Value),"[$-en-US]mm/dd/yyyy hh:mm:ss"))
    //Create this two variables on a button or apply them on each OnChange of Dropdowns of Date Time picker.
    
    DateDiff(DateTimeValue(varST),DateTimeValue(varET),Minutes) //formula on the Label's Text property

     

    This formula concatenate those two date and time picker results and using DateDiff function with the Minutes parameter to get the difference in minutes of those two time values. After this, you could apply an error message and patch function on the button like below. 

     

    If(Value(Label.Text)>600,Set(errorMessage,"Duration could not be more than 10 hours !"),Patch(DataTable,Default(DataTable),{StartTime:varST,EndTime:varET})

     

     

    Hope this helps.

     

    Best regards,
    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard