NC Device Capture
Not yet released: this component will ship in an upcoming Native Rent package version.
NC Device Capture uses the phone's hardware on a Flow screen. It can scan a barcode or QR code, read the device location, scan a document, read or write an NFC tag, or check that the user is the device owner with biometrics. It shows one mode at a time.
Hardware features work only in the Salesforce mobile app, and only when the device offers that feature. On desktop, the user can type a barcode, NFC value, or document text instead.
Use it to scan a Rentable's code and match it to a record, confirm the user is on site, attach a scanned document, or protect a step with biometrics.
Modes
Mode defaults to barcode. There is one layout, auto.
| Mode | API value | What it does | Example |
|---|---|---|---|
| Barcode or QR | barcode | One scan, or Continuous Scan for several values until the user taps Done. Optional Allowed Barcode Types. Optional Records to Match plus Match Field for an exact match. | Scan a Rentable's code and match it to a Rentable collection. |
| Location | location | Reads Latitude, Longitude, and Accuracy in meters. With a Target Latitude and Target Longitude, Is Near Target is true within Target Radius (Meters), default 50. | Confirm the user is within 50 meters of the pickup site. |
| Document scan | document | Scans a document when the device supports it, and outputs Document Text. With Save Scan as a File and a Record Id, it saves a File on the record. | Scan a paper form and attach it to the record. |
| NFC | nfc | Reads an NFC tag. Write shows only when Allow NFC Write is on and the device supports writing. | Read a tag on a piece of equipment. |
| Biometrics | biometrics | Checks that the user is the device owner. Outputs Verified. | Protect a confirmation step. |
Supported barcode types for Allowed Barcode Types: QR, CODE_128, CODE_39, CODE_93, DATA_MATRIX, EAN_13, EAN_8, ITF, PDF_417, UPC_A, and UPC_E. Blank allows all of them.
A saved document File is an image when the scanner returns one, otherwise a text File.
If the user cancels a scan, no error shows.
On desktop
On desktop, or when the device does not offer a feature:
- The hint "Available in the Salesforce mobile app." shows. Location and biometrics show a more specific message.
- Barcode and NFC show a text field so the user can type a value. Document scan shows a text area.
- Location cannot be read in a browser. Biometrics cannot be checked in a browser. Required still blocks Next.
Add it to a screen
- Add NC Device Capture to the screen. Pick one Mode.
- For barcode matching, map Records to Match and set Match Field. Set the record object type if you will use Matched Record.
- For location, optionally set the target coordinates and radius. To save a document File, turn on Save Scan as a File and set Record Id. Turn on Allow NFC Write only if you plan to write tags and the device supports it.
- Map the outputs for that mode in and out. Turn on Required if the user must capture before Next.
- Test the desktop fallback in a browser. Then test the hardware in the Salesforce mobile app. A desktop test alone does not prove scanning, location, document scan, NFC, or biometrics.
The setup panel shows only the settings for the selected mode.
Validation
- Required blocks Next until the active mode has a capture. In Biometrics mode, it blocks Next until the user is verified.
- Navigate After Selection (default
none) can move the flow after a single barcode scan, a location read, a document scan or File save, an NFC read or write, or a successful biometrics check. - Continuous barcode scans do not move the flow by themselves, because the user may still be scanning.
- The document File Id appears after the save finishes. Next cannot wait for that save.
Phone and desktop
Hardware features work only in the Salesforce mobile app, and only when the device offers the feature. Desktop browsers get the typed fallbacks, except for location and biometrics. 44 px touch targets apply at 600 px or less, or on a touch screen. NC Device Capture has no Color Map.
Limits
- Hardware features work only in the Salesforce mobile app. There is no browser location or browser NFC fallback.
- NFC write shows only when the device supports it. Many devices are read only.
- Document scan may be missing on some devices. The text area is always there.
- Record matching is an exact text match on one field.
- One mode shows at a time.
- Map the outputs in and out to keep a value if the screen is re-created.
Properties
| Property | API name | Default | Description |
|---|---|---|---|
| Label | fieldLabel | (blank) | Optional heading shown above the component. |
| Help Text | helpText | (blank) | Optional hint under the label. |
| Mode | mode | barcode | barcode (default), location, document, nfc or biometrics. |
| Continuous Scan | continuousScan | false | Barcode mode. Allow several barcodes in one session (the user taps Done when finished). Off (default) is a single scan. |
| Allowed Barcode Types | allowedTypes | (blank) | Optional comma-separated types, e.g. QR, CODE_128, EAN_13. Blank allows all supported types. |
| Records to Match | matchRecords | (blank) | Optional record collection to match against a scanned value. |
| Match Field | matchField | (blank) | Field API name on the records to compare with the scanned value, e.g. ProductCode. |
| Target Latitude | targetLatitude | (blank) | Optional. Decimal degrees. Used with Target Longitude and Radius to set Is Near Target. |
| Target Longitude | targetLongitude | (blank) | Optional. Decimal degrees. |
| Target Radius (Meters) | radiusMeters | 50 | When a target latitude and longitude are set, Is Near Target is true if the device is within this many meters. Default 50. |
| Record Id | recordId | (blank) | The record to attach a scanned document File to. Used in Document mode when Save Scan as a File is on. |
| Save Scan as a File | saveDocument | false | When a Record Id is set, save the scanned image or text as a File on that record. Off (default). |
| Allow NFC Write | allowNfcWrite | false | Show a write action when the device supports writing to an NFC tag. Off (default) is read only. |
| Required | required | false | Block Next until a value is captured (or, in Biometrics mode, until the user is verified). |
| Required Message | requiredMessage | (blank) | Optional. Blank uses the translated default. |
| Disabled | disabled | false | Show the component read-only. |
| Layout | layout | auto | auto (default). One layout; reserved so the component follows the kit layout contract. |
| Accent Color | accentColor | (blank) | Selected and focus color, e.g. #0B5CAB. Hex, rgb() or a color name. Lightened or darkened until it reaches 3:1 against the tile color (or the theme surface if no tile is set). Also tints the focus ring and the selected/highlighted row. Blank follows the org theme (and dark mode). |
| Background Color | backgroundColor | (blank) | Optional color behind the whole component. |
| Text Color | textColor | (blank) | Optional. On choices and results: used as-is on the theme surface, or checked at 4.5:1 against a tile color if one is set. On the label and help: checked at 4.5:1 against the background if one is set; otherwise dark or white text is picked automatically. |
| Text Size | size | medium | small, medium (default), large or xlarge. |
| Corner Shape | shape | rounded | rounded (default), square or pill. |
| Alignment | align | start | start (default), center or end. |
| Navigate After Selection | navigateOnSelect | none | none (default), next, back, finish or pause. After a successful capture the Flow can move on, so you can hide the screen footer buttons. Next and Finish check Required first; Next becomes Finish on the last screen. |
| Available Actions | availableActions | (blank) | Set by Flow; do not map. |
Outputs
| Output | API name | Type | Direction | Description |
|---|---|---|---|---|
| Scanned Value | scannedValue | Text | Input and output | The latest barcode or QR value (single scan, or the last value in a continuous scan). Map in and out to keep it if the screen is re-created. |
| Scanned Values | scannedValues | Text collection | Input and output | All values from a continuous scan (or a one-item list after a single scan). Map in and out to keep the list if the screen is re-created. |
| Matched Record | matchedRecord | Record | Input and output | The first record in Records to Match whose Match Field equals a scanned value. |
| Matched Records | matchedRecords | Record collection | Input and output | Every record in Records to Match whose Match Field equals a scanned value. |
| Latitude | latitude | Text | Input and output | Device latitude in decimal degrees, after a successful location read. |
| Longitude | longitude | Text | Input and output | Device longitude in decimal degrees, after a successful location read. |
| Accuracy | accuracy | Text | Input and output | Location accuracy in meters, when the device reports it. |
| Is Near Target | isNearTarget | Boolean | Input and output | True when a location was read and it is within the target radius of the target latitude and longitude. |
| Document Text | documentText | Text | Input and output | Text from a document scan, or text entered when the scanner is not available. |
| Document Content Document Id | documentContentDocumentId | Text | Input and output | Id of the File created when Save Scan as a File is on and a Record Id is set. |
| NFC Value | nfcValue | Text | Input and output | Text read from an NFC tag, or entered when NFC is not available. |
| NFC Written | nfcWritten | Boolean | Input and output | True after a successful NFC write. |
| Verified | verified | Boolean | Input and output | True after a successful biometrics check (checkUserIsDeviceOwner). |
Shared behavior
Layout and width, required messages, colors, navigation, data sources, translations, accessibility, and the setup panel work the same way on every component. See NC screen components.
To copy this component's settings to another screen, use Copy settings at the top of its setup panel. See Copy settings.