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.

ModeAPI valueWhat it doesExample
Barcode or QRbarcodeOne 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.
LocationlocationReads 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 scandocumentScans 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.
NFCnfcReads 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.
BiometricsbiometricsChecks 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:

Barcode mode on desktop: the mobile app hint and a text field. Required blocks Next until a value is entered.
Barcode mode on desktop: the mobile app hint and a text field. Required blocks Next until a value is entered.
Barcode mode on desktop after a typed code was added.
Barcode mode on desktop after a typed code was added.
Continuous barcode scan on desktop: the hint, a text field, and Add.
Continuous barcode scan on desktop: the hint, a text field, and Add.
Document scan on desktop: the hint and a text area with Add.
Document scan on desktop: the hint and a text area with Add.
NFC on desktop: the hint and a text field. No Write button shows.
NFC on desktop: the hint and a text field. No Write button shows.
Location on desktop: "Location cannot be captured in a browser. Use the Salesforce mobile app."
Location on desktop: "Location cannot be captured in a browser. Use the Salesforce mobile app."
Biometrics on desktop: "Biometrics are not available in a browser. Use the Salesforce mobile app."
Biometrics on desktop: "Biometrics are not available in a browser. Use the Salesforce mobile app."

Add it to a screen

  1. Add NC Device Capture to the screen. Pick one Mode.
  2. For barcode matching, map Records to Match and set Match Field. Set the record object type if you will use Matched Record.
  3. 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.
  4. Map the outputs for that mode in and out. Turn on Required if the user must capture before Next.
  5. 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

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

Properties

PropertyAPI nameDefaultDescription
LabelfieldLabel(blank)Optional heading shown above the component.
Help TexthelpText(blank)Optional hint under the label.
Modemodebarcodebarcode (default), location, document, nfc or biometrics.
Continuous ScancontinuousScanfalseBarcode mode. Allow several barcodes in one session (the user taps Done when finished). Off (default) is a single scan.
Allowed Barcode TypesallowedTypes(blank)Optional comma-separated types, e.g. QR, CODE_128, EAN_13. Blank allows all supported types.
Records to MatchmatchRecords(blank)Optional record collection to match against a scanned value.
Match FieldmatchField(blank)Field API name on the records to compare with the scanned value, e.g. ProductCode.
Target LatitudetargetLatitude(blank)Optional. Decimal degrees. Used with Target Longitude and Radius to set Is Near Target.
Target LongitudetargetLongitude(blank)Optional. Decimal degrees.
Target Radius (Meters)radiusMeters50When a target latitude and longitude are set, Is Near Target is true if the device is within this many meters. Default 50.
Record IdrecordId(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 FilesaveDocumentfalseWhen a Record Id is set, save the scanned image or text as a File on that record. Off (default).
Allow NFC WriteallowNfcWritefalseShow a write action when the device supports writing to an NFC tag. Off (default) is read only.
RequiredrequiredfalseBlock Next until a value is captured (or, in Biometrics mode, until the user is verified).
Required MessagerequiredMessage(blank)Optional. Blank uses the translated default.
DisableddisabledfalseShow the component read-only.
Layoutlayoutautoauto (default). One layout; reserved so the component follows the kit layout contract.
Accent ColoraccentColor(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 ColorbackgroundColor(blank)Optional color behind the whole component.
Text ColortextColor(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 Sizesizemediumsmall, medium (default), large or xlarge.
Corner Shapeshaperoundedrounded (default), square or pill.
Alignmentalignstartstart (default), center or end.
Navigate After SelectionnavigateOnSelectnonenone (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 ActionsavailableActions(blank)Set by Flow; do not map.

Outputs

OutputAPI nameTypeDirectionDescription
Scanned ValuescannedValueTextInput and outputThe 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 ValuesscannedValuesText collectionInput and outputAll 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 RecordmatchedRecordRecordInput and outputThe first record in Records to Match whose Match Field equals a scanned value.
Matched RecordsmatchedRecordsRecord collectionInput and outputEvery record in Records to Match whose Match Field equals a scanned value.
LatitudelatitudeTextInput and outputDevice latitude in decimal degrees, after a successful location read.
LongitudelongitudeTextInput and outputDevice longitude in decimal degrees, after a successful location read.
AccuracyaccuracyTextInput and outputLocation accuracy in meters, when the device reports it.
Is Near TargetisNearTargetBooleanInput and outputTrue when a location was read and it is within the target radius of the target latitude and longitude.
Document TextdocumentTextTextInput and outputText from a document scan, or text entered when the scanner is not available.
Document Content Document IddocumentContentDocumentIdTextInput and outputId of the File created when Save Scan as a File is on and a Record Id is set.
NFC ValuenfcValueTextInput and outputText read from an NFC tag, or entered when NFC is not available.
NFC WrittennfcWrittenBooleanInput and outputTrue after a successful NFC write.
VerifiedverifiedBooleanInput and outputTrue 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.