Skip to Content
Droot Developers

Field capture: photos, signatures, check-in evidence and offline work

Photo and signature fields, check-in evidence on a transition, and offline field work.

Four pieces of metadata let an app capture evidence in the field: a photo field, a signature field, a transition's evidence, and a model's offline flag. They are data in the app's bundle; the limits are each company's setting platform.capture (Settings › Field Capture). Apps that declare them require platform ^1.24.0.

Photo fields

{ "modelKey": "acme.visit", "fieldKey": "workPhotos", "label": "Photos of the Work", "type": "photo", "maxItems": 6 }

The value is the photos' file ids, in order. The device takes a photo with the camera (or picks one), scales and compresses it to the company's size and quality, uploads it, then its thumbnail:

Route Does
POST /api/views/:formView/records/:id/photos/:field?name= adds a photo (the bytes are the body; an image, at most maxPhotoKb)
POST …/photos/:field/:photoId/thumbnail?name= stores the photo's small copy
GET …/photos/:field/:photoId[?thumb=1] the photo, or its thumbnail
DELETE …/photos/:field/:photoId removes it

A field holds at most maxItems (≤ 50) and the company's maxPhotos. A record save may keep, reorder or remove photos, never name a file of its own (capture-fields command hook): photos go up through the route only, on a saved record.

Signature fields

{ "modelKey": "acme.visit", "fieldKey": "customerSignature", "label": "Customer Signature", "type": "signature" }

Drawn on the device with the signer's name: POST /api/views/:formView/records/:id/signature/:field?name=&signer= with the PNG as the body. The kernel stores the image as a file of the field and stamps the value:

{ "assetId": "…", "signer": "Asha Rao", "signedAt": "2026-10-15T10:02:11Z",
  "sha256": "sha256:<image>", "recordDigest": "sha256:<record at signing>", "hash": "sha256:<all of these and the record's identity>" }

GET …/signature/:field/verify recomputes the image's hash and the value's, and compares the record's digest: valid (nothing about the signature changed) and recordUnchanged (the record's other fields are as they were when signed). A save can clear a signature, never type one. To require one before a step, put the field in the transition's asks and add a field-required guard on it.

This is not a 21 CFR Part 11 electronic signature: the signer is not a signed-in user re-entering a password. For that, use the transition's signature policy.

Maps on location fields

A location field shows a place search (an address or a landmark; picking a result fills its latitude, longitude and address), the latitude and longitude inputs, Use My Location, and a map where a click puts the point. In view mode the saved point shows on a map too. The provider is the setting platform.maps (per company):

provider Search, addresses and tiles Needs
openstreetmap (default) Nominatim and the OSM tile server, or the company's own (osmSearchUrl, osmTileUrl) nothing
google The Geocoding API and the Map Tiles API a Google Maps connector (driver google-maps) with an API key

Google chosen with no enabled connector falls back to OpenStreetMap, and GET /api/geo/config says so (fallback, fallbackReason: "not-set-up"). A request Google can't answer is answered by OpenStreetMap instead. When Google refuses for its quota or credit (OVER_QUERY_LIMIT, OVER_DAILY_LIMIT, HTTP 429) or the key or billing (REQUEST_DENIED, HTTP 401 or 403), a circuit breaker sets it aside. The breaker is one record per connector in the maps_outages collection (platform/geo/outages.ts), so every kernel process sees it and it survives a restart; each process reads it at most every 5 seconds. While it is open every request goes to OpenStreetMap, the config says why (fallbackReason: "quota" or "denied", retryAt) and the map shows it. When the wait ends one process claims a probe and tries Google once (the others keep OpenStreetMap): an answer closes the outage, a refusal waits longer (30 minutes, 1 hour, 2 hours, then 4 hours at most). The users who hold connectors.admin get one notification when it opens, a reminder at most once a day while it lasts, and one when Google answers again; the writes are conditional, so exactly one process sends each. The connector's row in Setup › Connectors shows what Google said, the next try and the refusals in a row (notice on GET /api/admin/connectors), with Try Google Now (POST /api/admin/connectors/:key/maps-retry), which ends the wait. A record removes itself a day after its last try. Every call goes through the kernel (GET /api/geo/search?q=, /api/geo/reverse?lat=&lng=, /api/geo/tiles/:z/:x/:y), so the page's Content-Security-Policy stays same-origin and the Google key never reaches a browser. OpenStreetMap's public servers are used within their policy: a named User-Agent, at most one search a second, answers and tiles kept in memory; a busy instance should name its own servers.

A location field with a geofence draws the fence (its centre from against, its radius from radiusFrom or the setting) and says inside or outside, and how far, as the point moves: POST /api/views/:view/geofence/:field with the values the fence reads (the form field's fenceReads). The kernel still decides on save, with the accuracy policy.

Line attachments

{ "modelKey": "acme.bill", "fieldKey": "lines", "type": "table", "lineFiles": true, "columns": [ … ] }

A table field with lineFiles: true lets each saved line take files (a photo of the delivered item, a drawing, a test certificate): at most 20 a line, under the company's upload policy. The line's paperclip, in the grid and under the lines in view mode, opens its files to open, attach and remove. A line the kernel has not saved yet (on a new record, or just added) takes files too: the form holds them and uploads each to its line right after the save gives the line its id (a file that fails is named, to attach again; the record stays saved). A file is attached to the line by its row id, never written into the row, so the record's values and write rules are untouched: a posted or approved document's lines still take evidence, and each attach and removal is audited on its own. Reading needs the record and its table; attaching or removing also needs records.write and the role's update right on the table. A file follows its line: once the line is removed, its files no longer list or open. They also show in the record's Files tab with their line number. A tenant may turn line attachments on for an app's table (the attribute is overridable).

With lineFilesRequired: true as well (Line Attachments Required), every line needs at least one file. The form won't save a new line without a file waiting for it; the kernel refuses any later change to the record (a save or a transition such as Approve) while a line it already held has none (422 line_files_missing, naming the lines), and a line's last file can't be removed (attach the new one first). A line a write adds is exempt for that write only, since its files go up right after the save that gives it its id.

GET /api/views/:view/records/:id/line-files/:field lists them (files with each one's rowId, people, canAttach); POST …/:field/:rowId?name= attaches the request body's bytes; GET and DELETE …/:field/files/:fileId open and remove one.

Printing and exports

A document's layout prints a photo field with the Photos block ({ "type": "photos", "path": "record.workPhotos", "columns": 3 }) and a signature with the Image block (record.customerSignature), with record.customerSignature.signer and .signedAt in a field grid. A list's export writes each photo and signature as a link the reader opens with their own rights.

Evidence on a transition

{
  "key": "check-in", "label": "Check In", "from": ["scheduled"], "to": "checked-in",
  "evidence": {
    "location": { "field": "checkInLocation" },
    "photo": { "field": "checkInSelfie", "ruleFromSetting": "acme.capture.checkInSelfie" }
  }
}

The transition's dialog reads the device's location into location.field and offers a photo into photo.field. When it runs, the kernel refuses it (422 evidence_required) unless the record holds a point the device captured (source: "device") no older than the company's maxLocationAgeMinutes (unless required: false), and, when the photo rule is required, a photo taken in that window. The rule is off, optional (default) or required, or read per company from the app's setting field ruleFromSetting names.

The distance and the flag come from the location field's own geofence:

{
  "modelKey": "acme.visit", "fieldKey": "checkInLocation", "label": "Check-In Location", "type": "location",
  "geofence": { "against": "site.position", "defaultRadiusFromSetting": "acme.capture.radiusM", "mode": "flag",
    "flagField": "checkInAtSite", "distanceField": "checkInDistanceM", "unconfigured": "skip" }
}

unconfigured: "skip" saves the point unmeasured when the site has no position (or no radius is set), instead of refusing it.

Offline work

{ "key": "acme.visit", "offline": { "assignee": "technician", "where": { "status": { "$in": ["scheduled", "checked-in"] } }, "dateField": "scheduledOn" } }

The records whose assignee (a user field) is the signed-in user, matching where, due within the company's offlineDays (overdue ones included, at most offlineMaxRecords), are kept on that user's device: Field Work in the user menu (GET /api/offline/sets gives them with their form's values and flow steps). Saves, steps, photos and signatures made there wait in the device's outbox while offline and replay in order on reconnect through the same API; the kernel checks every one again. A field someone else changed in the meantime keeps their value, and the page says which. A tenant may turn a model's offline work on or off (the attribute is overridable).