ReadNFC

How to Use the Power Fx ReadNFC  Function in Power Apps

What is an NFC tag?

An NFC (Near Field Communication) tag is a small chip that can be embedded in objects such as posters, business cards, or products. These tags can be scanned by NFC-enabled devices such as smartphones or tablets to provide the user with additional information or functionality. For example, a business card with an embedded NFC tag could be scanned to add the contact information directly to the recipient’s phone.

How to use the Power Fx ReadNFC function

The Power Fx ReadNFC function is a powerful tool for reading data from NFC tags. To use this function, follow these steps:

1. Create a new screen in Power Apps.

2. Add a button to the screen.

3. In the OnSelect property of the button, enter the following formula:


Set(varNFC, ReadNFC())


This formula creates a variable called varNFC and assigns the output of the ReadNFC function to it.

4. Save and publish the app.

Now, when you click the button, the ReadNFC function will be called, and the data from the NFC tag will be stored in the varNFC variable.

Reading specific data from an NFC tag

By default, the ReadNFC function will return all the data that is stored on the NFC tag. However, you may only be interested in reading a specific piece of information, such as a URL or a phone number. To do this, you can use the ReadNFCRecord function.

The ReadNFCRecord function takes two parameters: the varNFC variable that contains the data from the NFC tag, and the record type that you want to read. For example, to read a URL from the NFC tag, you would use the following formula:


Set(varURL, ReadNFCRecord(varNFC, “Uri”))


This formula creates a variable called varURL and assigns the URL stored on the NFC tag to it.

The Power Fx ReadNFC function is a useful tool for reading data from NFC tags in Power Apps. By following the steps outlined in this article, you can easily incorporate this function into your own apps and create a more immersive user experience. So, go ahead and try it out for yourself, and see how the Power Fx ReadNFC function can enhance your Power Apps.

Power Apps Training Courses by G Com Solutions (0800 998 9248)