web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

Time Clock

(0) ShareShare
ReportReport
Posted on by 209

Would anyone know how to recreate this app created in this video? 

 

Time Tracker App using PowerApps and Power Automate - YouTube

Categories:
I have the same question (0)
  • TheRobRush Profile Picture
    11,128 Moderator on at

    Make a SharePoint list with a title column, 2 date time columns (time included) friendly format turned off

    put a timer in your app, hide it, set duration to 1, auto start on, repeat on, pause off

    OnTimerEnd

    Set(currentTime, Now())


    One button in app does in its OnSelect

    Patch(sourceName, {Title: User().FullName, startTime: currentTime})

    it's displaymode shoulde be something like

    If(
     Sum(AddColumns(sourceName, "addMe", If(Title=User().FullName && endTime=Blank(),1,0)), addMe)>0,DisplayMode.Disabled, DisplayMode.Edit)

    this will keep them from resubmitting with an unclosed clockin time

     

    clock out button something like

    Patch(sourceName, First(Filter(sourceName, Title=User().FullName && endTime=Blank())), {endTime:currentTime})
  • TheRobRush Profile Picture
    11,128 Moderator on at

    The example you shared is really not a great one to follow if you are new, seems like another user who is just starting with powerapps.

     

    if you need more info than i provided above

    try this video, it's what I would wager they followed

  • Broly123 Profile Picture
    209 on at

    @TheRobRush  Thank YOU VERY MUCH!! I have been looking for this solution for weeks! I used that video because my goal was to have the punch in and punch out automatically send the date and time back to SharePoint without user input but couldn't figure out how to clock in and out separately because the date and timer picker is set to default=Now().

     

    Question: Do I need to set variables? I created a Punch In button and used this formula, but it is asking for a record. What would be the correct record to insert after the sourcename?

    Patch(sourceName, {Title: User().FullName, startTime: currentTime})

     

    clock.PNG

     

    #2. Im also having an issue with the display formula. is "endTime" a variable I have to set?

    clock2.PNG

     

    #3. I have an error that says invalid arguments

    clock3.PNG

     

    again Thank you!!!!!!!

  • TheRobRush Profile Picture
    11,128 Moderator on at

    you need to go to your sharepoint list and create two columns, one that is startTime, and one that is endTime both date times with time included. delete whatever you had there before for those, and start with that. then try your patch again

  • Broly123 Profile Picture
    209 on at

    @TheRobRush  Awesome! It works! One issue is my "Punch In Button" is disabled even when I make selections in the dropdown box. I know its supposed to be the other way around with Punch In being able to be selected and Punch Out is disabled

    new 7.PNG

     

    timer.PNG

    I have timer Duration:1

    Auto Start: On

    Autopause:off

    Repeat:On

    OntimerEnd= Set(currentTime, Now())

     

    My second issue is on SharePoint, the two columns Start Time & End Time are not showing times when I click Punch In (I put it back to edit just to check if it would submit the times). If I select the default value to todays date, I still have the problem of both times being submitted when I want one at a time based on which button I press.

    start.PNG

  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    firstly, since you just started, remake those columns and name them startTime and endTime,  you never want to have spaces in a data structure name like you have thier 'Start Time' will be more trouble than its worth later on.

    Second, Your button is disabled because we set its display mode to disabled if the person using the app already has an entry in the list with no end time (they have clocked in but not clocked out) so their next clock should not be another clock in.

     

    Judging solely by your screenshot your splist should have 4 columns

     

    Title, startTime, endTime, and jobType

    on app you can remove punch type and just leave job type, employee id and punch in / punch out

     

    Punch in Buttons OnSelect would be (if you name your columsn exactly as I have)

     

    your onselect of punch in would then be

    Patch('Time List', 
     {
     Title: valueOfEMployeeIDDropdown.Selected.Value, 
     jobType: valueOfjobTypeDropdown.Selected.Value, 
     startTime: currentTime
     }
     )

     

     

    and punch ins display mode is still

    If(
     Sum(AddColumns('Time List', "addMe", If(Title=dropdownforemployeeid.selected.value && endTime=Blank(),1,0)), addMe)>0,DisplayMode.Disabled, DisplayMode.Edit)

     

    displaymode for clock out button will be opposite which is

    If(
     Sum(AddColumns('Time List', "addMe", If(Title=dropdownforemployeeid.selected.value && endTime=Blank(),1,0)), addMe)>0,DisplayMode.Edit, DisplayMode.Disabled)

     

    I'd also recommend setting visibility to both of these to whether or not they have selected an employee id yet, and if they have not do not show these two buttons at all.

     

    clock out button would be something like

    UpdateIf('Time List', Title=employeeIDDropdown.Selected.Value && endTime=Blank(), {endTime:currentTime})

     

    Now somewhere on your screen throw a label and set its value to something like

    Text(currentTime, "hh:mm AMPM") 

     

    so you can be sure that the current time variable is being set, and if that looks right submit a punch in

  • Broly123 Profile Picture
    209 on at

    @TheRobRush  I see that makes sense to why it's not showing. I edited the columns names to make it easier on my end as you suggested & will make Input hidden. The patch formula doesn't seem to like what I inserted. It says, "This type of argument 'Job' does not match the expected type 'Record'. Found type 'Text'. This  function patch has some invalid arguments."  Odd because the EmployeeIDDrop is a choice value just like JobDropDownUnless its because on sharepoint the "Title" column is a text choice automatically and the Job column I have set to choice Type? Here is my sharepoint list if it makes any difference.

    patch.png

     

     

     

    Sharepoint.PNG

    job sp.PNG

     

    FYI: I have the other columns hidden of course, the Date and Time is set to Now() along with the corresponding formulas to set current date to hours and minutes.

  • TheRobRush Profile Picture
    11,128 Moderator on at

    change your choice column and make it type of Single line of Text. Theres no real need for the choice column in powerapps as you can control the choices on the app side, and having the choice column on sharepoint side just makes it harder to delegate later. After you do that the record type thing will go away. CHocie columns are actually tables that look something like, {Value: "Choice 1", Value: "Choice 2:} etc and they get very messy in delegation later once your list goes over the normal 2k limit

  • Broly123 Profile Picture
    209 on at

    @TheRobRush  Will do, but why didn't it give me an error for employeeIDDrop either when it's also a choice column? I changed the Job column from "Choice" to a single line of text. Then added that field for the form. I changed the job: Jobdropdown to Job: Jobvalue.Text. Was that correct? Its not giving me an error message, however when I go to submit, the endTime Column is still not displaying. I believe it maybe due to the Timer never actually starting

    9.PNG

    9.1.PNG

    And my boss is really keen on having choice columns dropdown for the employees. Is there anyway to get that patch to work with the choice columns & with regards to delegation, are you saying that when we go over the 2k limit, the app won't be able to lookup if an employee is in an active session because of the 2k limit and the formulas will cease to function properly because it can't gather anymore info past 2k?

  • TheRobRush Profile Picture
    11,128 Moderator on at

    I dont think you understood what i said.

    I mean on the sharepoint side change the column the job is stored in to single line of text.

     

    In the app you can still have a drop down to select it, and just give that dropdown the items property of

    ["Job 1", "Job 2", "Job 3"]

     

    then in your patch you still refeence the dropdown.selected.value but you are patching it into a single line of text column now.

     

    No real need for the choice column on sharepoint side when you can control the choice on the app side and save your ability to search filter etc by the job column later in the app.

     

    once hyou have that done, a button doing this

    Patch('Time List', {Title: EmployeeIDDrop.Selected.Value, Job:JobSelectDrop.Selected.Value, startTime: currentTime})

     

    will give you a list record with the employee id in title column, job in job column, and start time in starttime column. end time WILL be blank because we have not clicked punch out yet, later on when we click that we use the update if to update the endtime

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard