> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/dynamic-components/components/nfc-tag-scanner.md).

# NFC Tag Scanner

The NFC Tag Scanner component bridges the gap between physical assets and your Salesforce data. It enables your application to read information from and write data to Near Field Communication (NFC) tags directly from a mobile device. By leveraging the native NFC hardware in most modern smartphones, this component eliminates manual data-entry errors and significantly speeds up field operations.

## Overview

Whether you are tracking inventory, verifying security badges, or logging maintenance on equipment, the NFC Tag Scanner provides a seamless, tap-and-go experience for your users.

**Common use cases**

* **Asset Tracking:** Read NFC tags on equipment to log details in Salesforce.
* **Inventory Management:** Scan tags to update stock or verify items.
* **Authentication:** Read NFC tags for user or device verification.
* **Event Check-ins:** Scan attendee badges for quick registration.

**Key considerations**

* Ensure user devices support NFC; test on mobile for best results.
* Use **Read** mode for data capture and **Write** mode for tagging items with IDs or URLs.
* Scanned data is available as output attributes (`value` and `valueCollection`) — use them to drive other components or interactions.
* Provide specific **Instruction Text** (e.g., "Hold device 2–3 cm away") to reduce scan errors.

## Configuration

To configure the NFC Tag Scanner, select it on the canvas. The configuration panel opens on the right. The sections below mirror the Properties tab.

### Properties

**Type**

The **Type** setting determines the scanner mode. Choose **Read** to capture data from an NFC tag, or **Write** to write a payload onto a tag. Defaults to **Read**.

**Open Onload**

When enabled, the scanner opens automatically as soon as the component loads, without requiring the user to tap the button.

**Instruction Text**

Custom instructions displayed inside the scanning interface to guide the user (for example, "Hold device near the NFC tag").

**Success Text**

The message displayed when a scan or write completes successfully.

### Payload

The **Payload** section is only available when **Type** is set to **Write**. Use it to define the data items that will be written to the NFC tag.

Each payload item has two fields:

* **Type** — the format of the data: **Text**, **URL**, or **Email**.
* **Value** — the actual content to write for the chosen type.

You can add multiple payload items to write several records to a single tag.

### Button

These settings control the trigger button that opens the scanner (when **Open Onload** is disabled).

**Label**

The text displayed on the button. Defaults to **Scan**.

**Variant**

The visual style of the button. Options include Bare, Bare Inverse, Base, Border, Border Filled, Border Inverse, Brand, Brand Outline, Container, Destructive, Destructive Text, Inverse, Neutral (default), and Success.

**Icon Name**

An optional Lightning Design System icon displayed on the button (for example, `utility:rfid`).

**Icon Position**

Controls whether the icon appears to the **Left** (default) or **Right** of the button label. Requires **Icon Name** to be set.

**Type**

The HTML button type: **Button** (default), **Reset**, or **Submit**.

**Stretch**

When enabled, the button expands to fill the full available width of its container.

**Disabled**

When enabled, the button is disabled and users cannot interact with it.

### Set Component Visibility

All components support conditional visibility — see [Component Visibility](/dynamic-components/core-concepts/component-visibility.md).

## Interactions

[Interactions](/dynamic-components/component-builder/interactions.md) define what happens when users interact with the NFC Tag Scanner. Configure them from the **Interactions** tab of the Edit NFC Tag Scanner panel.

### Successful Scan

Fires when an NFC tag is successfully read or written. The `value` and `valueCollection` output attributes are populated with the data from the tag — use them to update a record, show a notification, or navigate to a detail page.

## Output Variables

The NFC Tag Scanner exposes these output variables you can reference elsewhere on the page after the user interacts with it.

### Scan Result

When a user successfully scans or writes an NFC tag, these variables are populated with the tag's data.

| Output variable      | Type            | What it returns                                                                                                     |
| -------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------- |
| **Value**            | Text (String)   | The first value read from the NFC tag. Use it to reference the scanned data in text properties of other components. |
| **Value Collection** | Text Collection | All values read from the NFC tag. Use it when the tag contains multiple records.                                    |

> **Example:** When a technician scans an equipment tag, use **Value** to pre-fill the asset ID field in a record-create form on the same page.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.avonnicomponents.com/dynamic-components/components/nfc-tag-scanner.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
