Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Y0oYdgaNSA9c2ciZ6e82W4
Power Apps - Building Power Apps
Unanswered

QR Code Scan for Check in & Check Out

Like (0) ShareShare
ReportReport
Posted on 23 Jun 2022 11:40:20 by

Hi, I'm building a personnel on board tracking system.

 

the ideas is so simple. every time you scan the qr code, it will be patched into the datasource.

 

the question is, how to make patch formula so if a employee who last scan "CHECKED IN", then the next patch input automatically be "CHECKED OUT". 

 

and if the employee scan the QR code again, it will be patched as "CHECKED IN" again. 

 

i tried this formula but it doesn't work.

OnScan=

 

Patch(Table1,{CICO:If(IsMatch(Last(Filter(Table1,Name=BarcodeScanner1.Value).CICO).CICO,"IN"),"OUT",
IsMatch(Last(Filter(Table1,Name=BarcodeScanner1.Value).CICO).CICO,"OUT"), "IN")
,
Name:BarcodeScanner1.Value,
Date:Text(Now(),"dd/mm/yyyy"),
Time: Now() })

 

 

thanks

  • WarrenBelz Profile Picture
    146,745 Most Valuable Professional on 17 Jul 2022 at 23:07:43
    Re: QR Code Scan for Check in & Check Out

    Hi @ahmadfurqan ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • WarrenBelz Profile Picture
    146,745 Most Valuable Professional on 15 Jul 2022 at 04:37:07
    Re: QR Code Scan for Check in & Check Out

    Hi @ahmadfurqan ,

    Firstly, note that Date and Time are very bad names for fields, but I have included them in the below for structure

    With(
     {
     wScan:
     LookUp(
     Sort(
     Table1,
     ID,
     Descending
     ),
     Name = Self.Value
     )
     },
     If(
     wScan.CICO = "IN" && IsToday(DateValue(wScan.Date))
     Patch(
     Table1,
     {ID: wScan.ID},
     {
     CICO: "OUT",
     Date: Text(Now(),"dd/mm/yyyy"),
     Time: Now() 
     }
     ),
     Patch(
     Table1,
     Defaults(Table1),
     {
     CICO: "OUT",
     Date: Text(Now(),"dd/mm/yyyy"),
     Time: Now() 
     }
     )
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • Ramole Profile Picture
    Super User 2024 Season 1 on 15 Jul 2022 at 04:19:21
    Re: QR Code Scan for Check in & Check Out

    @ahmadfurqan 
    I have moved your post to correct section so you will get quicker response for help, going forward if you need any help post it this section please 
    https://powerusers.microsoft.com/t5/Power-Apps-Community/ct-p/PowerApps1  

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard