FileMaker Go 19 can read data from an NFC tag, which is one of the features under the “Smart AI. Smart Apps” umbrella, together with Siri Shortcuts and the use of Machine Learning models.
What is NFC?
Near-Field Communication allows for wirelessly sending small amounts of data over very short distances. Most of us use it often these days in the form of Tap-to-pay and other forms of contactless payments like Apple Pay with an Apple Watch. It is also frequently used for various keycards, perhaps to get access to the building where you work.
At its core, NFC is fascinating technology where your hardware (say your phone) supplies the power to activate a radio frequency field on an NFC tag, whose tiny radio antennas then transfer small quantities of data to your device. For this to work, your device has to be very close to the NFC tag, a distance of fewer than two inches.
NFC Power Source
The NFC tag itself is completely passive; it does not have a power source of its own. Radio waves from your device supply the power to activate it. This is one of the bigger differences with similar close-proximity communication technologies such as Bluetooth, where the ‘tag’ has its own power (usually a battery). Because of this, Bluetooth has a bigger broadcast range.
The NFC tag holds data but not a lot of it. The data can be written to the tag in a few different formats, as specified by the “NFC Data Exchange Format” (NDEF).
It is important to note that FileMaker Go can only read a subset of all these different formats; it supports these types of content:
- plain text
- XV card — which is a “Media” format of type “text/x-vCard”
- “Smart Poster,” which is a commonly used combination of text and URL
If the NFC tag holds data in another NDEF format, then it cannot read it.
NFC on iOS
Equally important is that not all iOS devices have the hardware capability to read NFC tags, even if they can use NFC for Apple Pay. iPads, for instance, do not have this capability, nor do some of the iPhones. The information about device compatibility is fairly muddled, but this source has a good overview.
How to Read an NFC Tag
To read an NFC tag, you invoke the new script step, Configure NFC Reading. The script step has two actions: Read and Cancel. The other configurations include the script you want to run when the scan is finished (or times out), a timeout period (the default is 45 seconds), and an option to scan continuously (well suited for scanning multiple tags in quick succession).
When you execute your script, and it reaches this script step, FileMaker Go will display the standard iOS NFC scan dialog:
When you hold the phone close to an NFC tag (and remember that the iPhone NFC chip is at the top of the phone), it will read the data from the tag and run the specified script.
In that script, you capture the result of the scan with the Get(ScriptParameter) function.
That result contains multiple lines of information and not just the data on the tag. The FileMaker Pro help describes what is included (see Figure 5). Line 1 will tell you if the scan was successful or whether it was canceled or timed out, which is something you’ll want to parse out immediately and branch the rest of the script around. Note that not every line will always contain a value.
An NFC tag that contains just a string of text, for instance, will return the result, as shown in Figure 6.
A tag with a URL will result in, note that line 7 specifies the ‘data type.’
If you cancel the scan or the scan times out, you will get the results as shown in Figures 8 and 9:
Other NFC Integrations
NFC scanning can also be integrated into your FileMaker apps in another way: Siri Shortcuts can be set up to start a flow with iOS itself, scanning a tag, rather than FileMaker Go doing the scan. Then in the Siri Shortcuts flow, you can use the new FileMaker Go 19 capability to have Siri call a script in your FileMaker app. This may prove to be useful if you need to take actions that are otherwise difficult to do from within FileMaker Go.
Next Steps with NFC in FileMaker Go
All in all, this new ability of FileMaker Go to read data from NFC tags is a very welcome addition that opens new possibilities. If you have questions or would like to enhance your FileMaker Go application, please contact our team.