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 (
valueandvalueCollection) — 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.
Interactions
Interactions 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.
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.
Styling
Configure the NFC Tag Scanner's appearance from the Style tab of the Edit NFC Tag Scanner panel. The button color sections adapt to the trigger button's Variant.
Controls the outer spacing around the component.
Top / Right / Bottom / Left: Adjust the space on each side.
Controls the inner spacing between the component's content and its border.
Top / Right / Bottom / Left: Adjust the inner spacing on each side.
Customizes the border surrounding the component.
Color / Size / Style / Radius: Set the border color, thickness, style, and corner rounding.
Styles the scan button (colors set per variant).
Background: Color / Color Active / Color Hover.
Border: Size / Style / Radius; Color / Color Active / Color Hover.
Text: Font Size / Font Style / Font Weight / Font Family / Line Height; Color / Color Active / Color Hover.
Shadow: Shadow / Shadow Focus.
Last updated
Was this helpful?
