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

Time Tracker

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello Community,

I'm working on an employee time tracker app that records the check-in, checkout, break-in, and breakout time of employees and is connected with a sharepoint list. The issue is whenever the app is closed or refreshed, the buttons reset to the pre-defined conditions I coded in power apps.

Global Variable on OnStart:

Set(checkin_pressed,false)

 

checkinbtn:

onselect: patch(); set(checkin_pressed,true)

DisplayMode: If(checkin_pressed,DisplayMode.Disabled,Edit)

 

checkoutbtn:

onselect: patch(); set(checkin_pressed,false)

DisplayMode: If(!checkin_pressed,DisplayMode.Disabled,Edit)

 

 

Problem.jpg

Every time I close the app and start or refresh it again check-in is enabled and checkout is disabled.

I want it if the user clicked on the check-in button and closes the app. The next time when the app is opened, it should remember check-in was pressed(it will be disabled) and only shows the checkout button. I'm new to power apps please help me on this matter.

Categories:
  • Verified answer
    MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    You will need to store the status for example on check in store status to show checked in. The add a lookup on the displaymode of the button that checks the status, if status = checkedin then disable else enable.

     

    Would you like help with the formula?

     

    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful because this can help others.

    LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
    YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
    Twitter: https://twitter.com/phipps0218

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @phipps0218 ,

    can you please explain it briefly ?

    should i use if condition and lookup inside it?

    and i want this for specific user(i.e if he has already checked-in so only checkout should be enable for him), so what will be the condition?

    Your help will be really appreciated.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Not sure if you've seen it, but you might take a look at this video for time tracking that could provide some processes and ideas to improve your app and solve some issues.

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @RandyHayes,

    I already watched your video before working on this project and it helped me a lot.

    but here I am going with another approach and my SP list columns are different than yours.

    I am storing check-in checkout break-in and breakout time in separate columns in the SP list. The condition given to me is working hours of a given organization is 5 pm to 2 am. So the idea given by @phipps0218 where he suggested to use lookup condition or filter function is giving me some trouble figuring out the right condition to work it out right . 

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Yes...I was just mentioned in case you didn't see it.  Glad it helped get you started.

     

    Keep at the idea from @phipps0218  you are working on now and, of course, post back with issues!

  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    You need to store in Sharepoint the user and Status. Please let me know column names and table name and I write the formula

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @phipps0218, Sorry for the late reply.

    Screenshot 2022-09-26 100912.jpg

    This is my SharePoint list, I tried what you suggested to me but I couldn't figure out the right condition to get my solution. I tried to set a global variable in onStart screen:

    Set(e_status,LookUp(TimeTracker,StartsWith(Status,"Ch") && Title=User().Email,Status))

    and checking it in if condition on OnDisplayMode, but it is not working well.

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Ok so i used this expression on the OnStartApp property,

    If(
    LookUp(
    SortByColumns(
    TimeTracker,
    "ID",
    Descending
    ),
    StartsWith(
    Status,
    "C"
    ) && Title = User().Email,
    Status
    ) = "Checkin",
    Set(
    checkin_pressed,
    true
    ),
    Set(
    checkin_pressed,
    false
    )
    );

    and checkin_pressed is used in DisplayMode.

    My App is working fine now. @phipps0218 Thanks for your idea.

  • kimmie13 Profile Picture
    2 on at

    Hi @taimoorahmed897,

     

    Do u mind to share your time tracking power app zip file?

    Im newbie on power app would like to learn by amending a built app...

    Appreciate if you could share it...

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @kimmie13 ,

    Sorry I cannot share this app because I developed it for my company. But if you need any help regarding powerapps you can inbox me. I will surely help you. You can watch Randy Hayes's video on the attendance app, which can help you if you want to build a time tracker app.

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