Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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?
  • jamos13 Profile Picture
    27 on at
    ReadNFC and set variable with text from the NFC record
    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard