NFC Tags

NFC tags are small tags or stickers which can contain some data.  Bringing your mobile device near to one of these tags, you can read the data or (if the tag allows it) write some data there.

In FormsFly, the NFC field type allows you to build Form screens that can read and write NFC tags using Android devices (Apple don’t support this technology as yet).

A good way to experiment with NFC fields is by using some inexpensive NFC stickers (also called tags).   You can purchase these online, just run an internet search for the term “NFC Stickers”, or take a look at http://rapidnfc.com/.

There are two operations you can perform against a blank or new NFC tag/sticker:

  • Read values from the tag
  • Write value to the tag (if the tag permits)

Overall NFC Field Properties

When working with tags, you must specify a MIME type which the app will use for read/write operations on that NFC field.  For example, if you will store text data on your tag, then you can specify a MIME type of

text/html

You can specify your own custom mime types. For example…

application/vnd.nameofyourapp

…where nameofyourapp is any unique name you wish, without spaces.

You set the MIME type via the “Read/Write MIME Type” property found on the NFC field’s properties in the Form designer.

If the MIME Type is set, then you can ignore the property called “Read Value From” – just leave it set to “All”.

Reading Data

Once a MIME type is set, then when you run up the app, you will see a Read button appear on the NFC field.

If you hit the Read button and then tap your device to the NFC tag/sticker, the value stored against the given MIME type record will be set as the answer of the NFC field.

Should you have any subsequent Form fields that have formulae depending on the NFC field’s value, then those will be triggered by the read operation.

Writing Data

If you just want towrite static values onto your tags, which you will later read with your FormsFly app, then you might be best to use an NFC writing tool, such as NXP’s “TagWriter“.  Have a search on Google Play.

If you wish to write your tags dynamically, based on your form entries in FormsFly, read on…

You can determine whether this is going to be a one-shot write (after which the tag will be permanently read only) or whether you would like to be able to write and re-write the tag. Do this using the tick box labelled “Lock Tag on Write”.

When it comes to what will actually get written to the NFC tag, this is controlled via the “Write Value” property found on the NFC field in the Form designer.

You must specify a formula which gives a text/string result in this property.

A simple form field reference such as {{myfield}} will not work as a Write Value, you need to use the field in a formula function such as CONCAT().

The formula result will be written to the MIME type record on the tag via a Write button that appears on the app when a write formula is specified.

For instance, you could specify CONCAT(USERLASTNAME(), ‘, ‘, USERFIRSTNAME()) as the Write Value formula.

When Apple provides NFC support on iOS devices, we will be looking to support NFC there too.