I recently came back from Sydney and I now have 4 new Opal cards. Opal card is used in public transport across Sydney and these cards use NFC technology. Since I no longer have any use for these cards in Melbourne, I wanted to do some thing productive with these cards. I also wanted to try a low cost alternative for triggering Flow from a hardware that is not flic (Opal cards are free).
Reading NFC card is not a native functionality of Flow, so I decide to use something that is capable of reading NFC card and also can call a HTTP endpoint. Since I am using Android, there is an app that meets this need perfectly. It is called Automate. This app has been around for a while, and you can develop Automate Flows that can use native hardware capability of Android.
Here is how my Flow looks in Automate.
The are start important blocks to get this Automate Flow working:
Read NFC block is used to read the NFC card. I map the NFC tag id to the variable called “TagId”. You can use the “Read tag” button in this to identify the NFC tagid and then use it in the switch/case statements in Microsoft Flow.
The next step in the one where I call Microsoft Flow, which is triggered by HTTP Request.
The same Automate Flow has to be triggered again after Microsoft Flow is called using HTTP Request, so that a new fiber is started to continue reading the NFC card.
This is the Microsoft Flow that is triggered by HTTP request.
The HTTP trigger accepts the tagId in the URL parameter of the HTTP Request.
Based on what tag has been scanned, I can then perform the appropriate action. I use the switch statement for this purpose.
Here is a quick demo of Automate and Flow working together in harmony.
Here are somethings that are now possible with the NFC capability:
- Deploy solution from DEV to TEST, using Azure Function, PowerShell and Xrm.Data.PowerShell module. I experimented with this and it works nicely even though PowerShell support in Azure Function is only experimental
- Call a RunBook in Azure Automate using HTTP Webhook
I hope this is useful in scenarios where you need alternate ways to trigger Microsoft Flow.