web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / ReadNFC and set variab...
Power Apps
Unanswered

ReadNFC and set variable with text from the NFC record

(2) ShareShare
ReportReport
Posted on by 27
Hi, I am trying to create an app that will read an NFC tag and send a notification to a teams channel with information from the tag. The test I am using is an emergency assistance notification. The NFC tag only has a text record with the room name. I've gotten it where it works after the first scan, but ideally need the first scan to actually work.
 
I have a button, "Conf Assistance" where the OnSelect property is set to the below;
With(ReadNFC(),
    Set(id, Coalesce(Identifier, "No ID"));
    ForAll(NDEFRecords,	
		Collect(tagRecords, {ID: id, Value: Coalesce(Text, URI)})));
Set(varRoom, Title4.Text);
FlowTest.Run(varUserEmail, varRoom);
The first tag scan using the above will result in an error for text_1, which refers to varRoom in the FlowTest.Run section stating that there is no text. It does work on the second scan; however, I am assuming it is because it is trying to run all of this at the same time and the second scan has allowed enough time for the Gallery to populate. Is there a better way to accomplish this without adding a second button to press in the app? Can I have something trigger when an item is added to the gallery from Power Automate?
Categories:
I have the same question (0)
  • jamos13 Profile Picture
    27 on at
    I sort of have an alternate solution while I try to find one that's more practical, but you can set the OnStart property to Scan and collect the NFC information, then have the button to set all the variables for the flow to run. I'll include code if anyone wants to use this in the future.
     
    OnStart:
    With(ReadNFC(),
        Set(id, Coalesce(Identifier, "No ID")
    	);
        ForAll(NDEFRecords,	
    		Collect(tagRecords, {ID: id, Value: Coalesce(Text, URI)}
    				)
    			)
    		);
     
    Then, your button's OnSelect property to set any additional variables using tag info and run your flow:
    Set(varConf, Title5.Text); If(conferenceroomassistancetest.Run(varUserEmail,varConf))
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard