Add an NFC Widget

About this task

Use the NFC widget to allow app users to scan and collect data from Near Field Communication (NFC) tags. When an app user scans an NFC tag with the app, the device's internal NFC tag reader reads the tag and transfers the tag's data into designated fields in the app. You can only insert one NFC widget per app screen.

Note: This widget is only supported on Android devices.

Procedure

  1. In the Canvas, open the Widgets tab.
  2. Double-click or drag and drop the NFC widget onto the app canvas.
  3. In the NFC Properties panel, enter a name for the widget in the Name field.
  4. Enter a label for the NFC tag field in the Display text field.
  5. Choose when to start the NFC scan.
    • On click: starts when the widget is clicked
    • On page load: starts when the page loads
    If you have multiple NFC widgets in a SOTI Snap app, they must all have On click selected.
    Tip: Add an OnRead event with a Map Read Data action to save the read NFC data to text boxes in the SOTI Snap app.
  6. In the Text Formatting section, change the default formatting settings for text.
  7. Choose how you want to align your widget in the app.
    • Align Left
    • Center
    • Align Right
  8. Optional: Add a visibility rule to the widget.
    Use visibility rules to control when a widget is visible to the app user. For example, you can create a condition that a widget should only appear after the app user fills in a field or submits a form.
    1. Select Visibility Rule to open the Set Visibility Rule dialog box.
    2. Select whether the visibility rule requires meeting all or any conditions.
    3. Select an app field or variable and an operator from the Field list. Enter the value required for the widget to be visible.
    4. Select Add Condition to add another condition.
    5. Select Save.
  9. Move to the Format tab to customize the widget's appearance.
  10. Optional: Add an OnRead event and actions to the widget. Events are activities that you can set to trigger an Action. The OnRead triggers when an NFC tag is detected.
    Important: Due to the complex combinations available to use, the following steps are guidelines only. You'll need to replace the listed events and actions with your own to suit your app's needs.

    Learn more about the available events and actions at Events and Actions.

    1. Switch to the Events tab.
      Events tab in Widget configuration panel
    2. Choose the OnRead event from the Events dropdown list and then click Add beside Actions.
    3. Select the Map Read Value action and configure it.
      Note: You must configure the Map Read Value action before you configure any other actions.
    4. Click Add to apply it to the widget.
    5. Click Save to save the action.
    6. Repeat for any additional event and action combinations and return to the Widget Properties tab.
  11. Select Save in the SOTI Snap banner to apply your changes.
    Save app button

Results

Tip: Select Preview to see how the widget appears in your app.