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 / Linking NFC Reader val...
Power Apps
Unanswered

Linking NFC Reader value to form in PowerApps

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all, I've got a bit of a puzzle for you so I will explain the best I can below: 

 

So, I am currently building an app that is supposed to manage assets. A user should be able to scan an assets tag (barcode or NFC) and then they will be taken to the form either, A - Showing them the asset that relates in the pre-populated form view to that tag if the asset is found, or B - If the Asset is not found, navigate to the form view with the NFC/Barcode fields pre-populated with the record that has just been scanned, but everything else empty as the record does not exist. 

 

I managed to achieve this result using the with the Barcode Scanner using this code: 

 

Set(

//varSelected is the variable that is the 'item' property of the form.
varSelected,
LookUp(
Assets,

//'Bar Code' is the column name in the data source.
'Bar Code' = First(Self.Barcodes).Value
)
);
If(
!IsBlank(varSelected),
Set(
varFormMode,
FormMode.View
),
Set(
varFormMode,
FormMode.Edit
);
Set(
varBarcode,
First(Self.Barcodes).Value
)
);
Navigate(ViewAsset_Screen); 

 

Now I need to apply this to the NFC Scanner in a similar fashion, any help would be greatly appreciated 🙂

Categories:
I have the same question (0)
  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    To achieve a similar result with an NFC scanner in Power Apps, you can follow a similar approach to the one you used with the Barcode Scanner. Here's an outline of the steps:

    1. Create an NFC scanning functionality: Set up the NFC scanner to read the tag and retrieve the scanned value. You can use the NFC.Scan function to accomplish this. Make sure you have the necessary permissions and configuration set up for NFC scanning in your app.

    2. Use the scanned value to search for the corresponding asset record: After obtaining the scanned value from the NFC tag, you can use it to look up the related asset record in your data source. In your formula, replace First(Self.Barcodes).Value with the NFC scanned value.

      For example:

     

    Set(
     varSelected,
     LookUp(
     Assets,
     NFCScannedValueColumn = ScannedValue
     )
    );

     

    1. In this example, NFCScannedValueColumn refers to the column in your data source that stores the NFC tag values, and ScannedValue represents the value obtained from the NFC scanner.

    2. Navigate based on the lookup result: Check if the asset record was found based on the lookup result. If a record is found, navigate to the form view showing the existing asset. If no record is found, navigate to the form view with the NFC/Barcode fields pre-populated.

     

    If(
     !IsBlank(varSelected),
     Set(varFormMode, FormMode.View),
     Set(varFormMode, FormMode.Edit);
     Set(varNFCValue, ScannedValue)
    );
    Navigate(ViewAsset_Screen);

     

    1. Here, varFormMode is a variable to track the mode of the form (view or edit), and varNFCValue is a variable to store the NFC scanned value for pre-populating the NFC/Barcode fields in the form.

    Remember to adapt the code to match your specific data source, column names, and variable names. Additionally, ensure that you have the appropriate permissions and configurations set up for NFC scanning in your app.

    This approach should help you achieve the desired functionality with an NFC scanner in your Power Apps asset management app.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Shaheer, 

     

    This doesn't seem to work. When the tag is read, it seems to store the identifier value in the variable correctly, but the issue is getting it into the form. When the form is navigated, it just says 'getting your data' and is stuck there. I presume it's something to do with the 'varSelected' element of the formula as the item of the form is 'varSelected'. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 602

#2
WarrenBelz Profile Picture

WarrenBelz 473 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 310

Last 30 days Overall leaderboard