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 / Timekeeping app help
Power Apps
Answered

Timekeeping app help

(0) ShareShare
ReportReport
Posted on by 29

Hello Power Community,

Noob here.  My app has more unsuccessful versions than the Oxford dictionary has words.  Well, close anyway.  There is not much out there to help with a timekeeping app.  That didn’t stop me.  In a nutshell, I am working from OneDrive to update an excel sheet.  The data is pre-populated daily.  It will utilize a camera or a scanner to read a barcode (EMPLOYEE_ID).  Successful testing is sporadic. My long-winded goal is to use an input such as a toggle, radio buttons or a dropdown choice.  It would represent in and out.  Currently they each have their own page because of an iffy IF statement.  One thing to really help get the ball rolling is this:

I want to be able to update the selected item that is narrowed by the ID for the IN time currently

Scanner trigger

Patch(tblData,First(Filter(tblData,EMPLOYEE_ID=TextSearchBox1.Text)),{IN: Now()})

Camera trigger

Patch(tblData,First(Filter(tblData, EMPLOYEE_ID = BarcodeScanner1)),{IN: Label2});Reset(TextSearchBox1);SetFocus(TextSearchBox1)

(It doesn’t like the equal sign on this one and Label2 is the time result)

How can I word it to allow the value of toggle1 to choose the IN or OUT record to be updated this record only?

A manual scan shows the barcode in the search box and isolates the lone record.  A trigger is used to update the record.  Lastly critique and correct my verbiage for “This record”.  It works on and off and I would like something more hearty.  I have included a timer to allow thinking time before resetting which helps.

 

Much thanks!

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at

    Try:

    Scanner trigger (convert TextSearchBox1 to Value)

     

    Patch(tblData,First(Filter(tblData,EMPLOYEE_ID=Value(TextSearchBox1.Text))),{IN: Now()})

     

    Camera trigger (Add . Text to label)

    Patch(tblData,First(Filter(tblData, EMPLOYEE_ID = BarcodeScanner1)),{IN: Label2.Text});Reset(TextSearchBox1);SetFocus(TextSearchBox1)

     

    Or

    Patch(tblData,First(Filter(tblData, EMPLOYEE_ID =Value (BarcodeScanner1))),{IN: Label2.Text});Reset(TextSearchBox1);SetFocus(TextSearchBox1)

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

    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.

  • dzi Profile Picture
    29 on at

    TextBoxSearch1 has BarcodeScanner1 as a default.  Were you suggesting I change the default to the word "Value"?  This will create a conflict.

  • eka24 Profile Picture
    20,925 on at

    I assumed that employeeID is a number column so placing the value around barcodescanner1 Will let the two field match. If employeeID is not a number column, then value is not needed there.

     

    From your last reply, you said TextSearchBox1 Defaults to the scanner. If so then change the formula to:

     

    Patch(tblData,First(Filter(tblData, EMPLOYEE_ID =TextSearchBox1.Text)),{IN: Label2.Text});Reset(TextSearchBox1);SetFocus(TextSearchBox1)

     

    Or if EmployeeID is a number column

    Patch(tblData,First(Filter(tblData, EMPLOYEE_ID =Value (TextSearchBox1.Text))),{IN: Label2.Text});Reset(TextSearchBox1);SetFocus(TextSearchBox1)

     

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

    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.

     

  • dzi Profile Picture
    29 on at

    Any thought on how to incorporate a toggle to determine {IN: Label2.Text} from {OUT: Label2.Text} ?

  • Office365Master Profile Picture
    338 on at

    @dzi wrote:

    Hello Power Community,

    Noob here.  My app has more unsuccessful versions than the Oxford dictionary has words.  Well, close anyway.  There is not much out there to help with a timekeeping app. 


    Whilst I think others are pointing you in the right direction insofar as your question is concerned, out of interest I did post a blog on an Attendance Tracking app I've developed. Similar conceptually at least to a timekeeping app.

     

    The blog itself probably won't help you all that much, however it does have some pretty cool techniques around developing the UI for an app such as timekeeping app. Maybe it may help you in some shape or form, or not 😊!

    https://masteroffice365.com/power-apps-showcase-attendance-tracking-app/

  • eka24 Profile Picture
    20,925 on at

    Your question not clear to me but generally, Toggle is a Boolean, true or false.

     

    So you can try If(Toggle1.Value=true,...,....)

    You can make your question clearer

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

    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.

  • dzi Profile Picture
    29 on at

    How would that be incorporated into the code we have already discussed?  Something like this?

    Patch(tblData,First(Filter(tblData, EMPLOYEE_ID = BarcodeScanner1)),if(toggle1=0{IN: Label2,OUT:Label2});Reset(TextSearchBox1);SetFocus(TextSearchBox1)

  • Office365Master Profile Picture
    338 on at

    Maybe my patch statement in my attendance tracking app may actually help you, albeit that in my app I mark attendance for all people present for a given day in a single record for that class in a SQL table. The statement I use when editing that same day's attendance is akin to you having prepopulated the list of employees for the day, first signing in, then out.

     

    For the code below, currentclassid_v would thus map to TextSearchBox1.Text. However to "fix" the timer issue you have what you should really do is use a variable you update in the OnChange property of the TextBox.

    OnChange: UpdateContext( employee_id_v: TextSearchBox1.Text )

     

       Patch( '[dbo].[AcademicAttendance]';

              First( Filter( '[dbo].[AcademicAttendance]';

                     id=currentclassid_v

              ));

              { userspresent: First( LocalAcademicAttendanceWIP ).userspresent;

                modifiedbyid: loggedin_user_v.id;

                modifieddate: Now();

                lastsyntime: Now()

              }

       )

     

    My "userspresent: First( LocalAcademicAttendanceWIP ).userspresent" is a column mapped to a Concat of all selected students present in a gallery using a checkbox (e.g "studentid-1, 1; studentid-2, 2; studentid-3, 1; studentid-4, 1" ).  Just saying so you don't get confused. I found doing it this way with one record for the class for the day made the app super efficient however it did add complexity to denormalize it for reporting and/or editing. Once it was working I wouldn't do it any other way because of how quick it makes marking attendance.

  • Verified answer
    eka24 Profile Picture
    20,925 on at

    Try:

    Patch(tblData,First(Filter(tblData, EMPLOYEE_ID = BarcodeScanner1)),

    {IN:Label2.Text,

    OUT:Label3.Text});

    Reset(TextSearchBox1);

    SetFocus(TextSearchBox1)

     

    Assuming you have different labels for I and Out:

     

    In Label2

    If(Toggle1.Value=true,1,0)

     

    Out Label3

    If(Toggle1.Value=false1,0)

     

    With this both columns will be Patched but one Will be 0 and other 1

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

    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.

     

     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#2
11manish Profile Picture

11manish 205 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard