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
Unanswered

Time recording app

(0) ShareShare
ReportReport
Posted on by 4

I would like to add a pop up to a time recording app which flags when a user has manually inputted more than 8 hours worth of time in one day.  

 

I need to filter my collection(all entries) based on the users name, and the date being selected in the manual time recording screen to look at the already recorded times (task duration) for them and add on to this the new time they are recording (TxtTotalTime), in order to then flag up a message stating  "You have recorded over 8 hours today" Below is my current failed attempt:

 

Label Text: 

If(Sum(Filter(AllEntries, 'AgentID' = NamePicker_2.Selected.UserPrincipalName && 'StartTime' = DateTimeValue(Text(StartDate.SelectedDate))), Text(
Value(TaskDuration)+ TxtTotalTime.Text)) >= 541, "You have recorded over 8 hours today")

 

Screenshot 2022-12-20 122818.png
Categories:
  • WiZey Profile Picture
    3,023 Moderator on at

    Hello @CarlLark ,

     

    Why did you put your formula in the "DisplayMode"? This property expect "Disabled", "Edit" or "View" as values, not a text. You probably should put it in the "Text" property of your Label.

     

    If you want a pop-up to appear, you can use "Notify()".

     

    Also, I'm not sure your "Sum()" is properly populated. The 1st parameter should be a table (OK here) and the second parameter should be a "ColumnName", meaning a column from your list. 

  • CarlLark Profile Picture
    4 on at

    Hi,

    thanks for this - I have added this to the text property instead and made a few adjustments to the formula, but it is now only picking up the TxtTotalTime.Text)) >= 541, "You have recorded over 8 hours today" part and skipping the table I want to filter (AllEntries). I need to Sum up the filtered entries total minutes recorded by subtracting the Start time entry from the End time entry (both columns within my list) and add on the time being recorded on the current screen (TxtTotaltime) if it equates to over 541 minutes the message should display. 

    CarlLark_0-1671796792248.png

     

  • WiZey Profile Picture
    3,023 Moderator on at

    I can give a few pointers:

     

    • Is "EndDate.SelectedDate" a Datepicker? You don't need to convert it from date to text to date as it already returns a date to begin with
    • You're checking if "EndTime" is equal to "EndDate". This means it will only return records whose "EndTime" = "EndDate", when you perhaps meant "EndTime" <= "EndDate" which should return more records ?
    • Try to check if your "Filter()" returns a value, and if "Sum()" returns the value you're expecting too

    Otherwise, the whole formula seems correct to me. I think it's only an issue in the conditions provided to the "Filter()".

  • CarlLark Profile Picture
    4 on at

    Thanks for these pointers. Both filters work separately, however when used together the formula doesn't return anything. I am able to filter my results by either the selected User and sum up the task duration, or filter by the selected date and sum up the task time. 

    So it is obviously an issue with these filters working together - perhaps on such a large data set. 

     

    If you have any ideas on how I can filter my results on both columns and then sum up the total duration they would be greatly received! 

     

    thanks,

     

     

  • WiZey Profile Picture
    3,023 Moderator on at

    That does seem weird if your "Filter()" is unable to find a single record who validate both conditions at the same time, when it's able to return a table when using only one condition at a time.

     

    I would first recommend checking your list's integrity, for example if the agent's name and end time are indeed both equals to the conditions you're providing.

     

    If it is, then perhaps you could try nesting a "Filter()" and see how it goes?

     

    Filter(
     Filter(
     source,
     Agent = "Name"
     ),
     EndTime = SelectedDate
    )

     

    This is basically what you already did, however, I can't find any fault in the formula you're showing and I can only think it's the data who's to blame.

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard