Skip to main content
11 December 2023
Follow Us

Power Apps: How to create a Clock In app by scanning NFC tags

In this post we're going to look at a simple Clock In application, an app that allows you to manage the entry and exit of a company's employees. We'll cover its functionalities as well as the path it took throughout its development.

 

Step 1

To create this application in Power Apps we used a few controls, the main ones being: a vertical gallery and a button.
It is this button that allows the user, when pressed, to read the NFC tag that indicates the entry/exit of an employee from the company. Once the NFC tag has been read, the employee's name (Title column), email (Email column), clock-in/out times (Dia e Hora column) and whether the employee is joining or leaving (Entrada/Saída) are passed on to a Sharepoint list. This code was used to read the NFC tag and map the different fields:
 
With(ReadNFC(),
Set(id, Coalesce(Identifier, "No ID"));
ForAll(NDEFRecords, Patch('Controlo de Ponto', Defaults('Controlo de Ponto'), {'Entrada/Saída': Coalesce(Text, URI), Title: User().FullName, Email: User().Email, 'Dia e Hora': Now()})));
 

Step 2

It is via the Sharepoint list that the gallery will be filled with data, so that you can see all the entries and exits directly in the application.
 

Step 3

The app also allows you to check how many employees are currently in the company, with the number increasing after each entry and decreasing after each exit. To perform this calculation, the following code was placed in the Text property of a label:
 
CountRows(Filter(Gallery1.AllItems, 'Entrada/Saída' = "ENTRADA")) - CountRows(Filter(Gallery1.AllItems, 'Entrada/Saída' = "SAÍDA"))
 
With just these three steps it is possible to create a very simple Clock In app, which you can see below in a short demonstration. For an improved version of the application, stay tuned for the next post.
 
Vídeo sem título Feito com Clipchamp 5

Ficheiros em anexo


Assine a nossa newsletter e receba o nosso conteúdo diretamente no seu email