Offline is a deliberate form type
An offline KayanOS form is for field work that must continue through a connectivity gap. It is not a regular form that happens to be opened without a network. Before the field visit, an authorized member downloads/prepares the form package while connected. The device then keeps the form definition, local sessions, attached files, and synchronization queue locally until it can send a submitted session to KayanOS. Use it for a Field Inspection Team recording repeatable observations and photographs at a Service Centre locality. Do not use it when the work needs live entity lookups, public access, a prefilled link, dynamic workflow actions, or a data-dependent authorization decision at the point of entry.
Decide whether the form is suitable
Choose an offline form only after answering these questions:
An offline form should be small, clear, and self-contained. If a requirement cannot be tested without connectivity, make it a regular form or move the review step to the synchronized workflow.
What KayanOS stores locally
The device’s local offline store keeps four related kinds of data:
This design allows the app to replace local file references with uploaded KayanOS file references before it commits the server session. It also means a lost, wiped, or inaccessible device can contain the only copy of an unsynchronized submission. Establish a device-handling and incident process before relying on offline work.
Sync states: what they actually mean
Every offline session and queue item moves through these states:
The synchronization worker avoids parallel cycles, waits for the browser to be online, checks due items on an interval, and runs when connectivity returns. Failed attempts use increasing backoff starting at about five seconds and capped at five minutes. These timings are a recovery mechanism, not a promise that a submission will reach the server without review.
Build an offline inspection form
Use the Citizen Service Request inspection scenario to configure a first version:- Create an Offline form for the Field Inspection Team while connected.
- Add only local-friendly fields: request reference, site address, inspection date/time, safety status, a repeatable Observation section, a note, and a file field for photographs.
- Set fixed select options such as
safe,unsafe, andfollow_up_required. Do not use an entity-backed option source for a list that must work without the server. - Give the Observation section a sensible minimum/maximum count and test one row, multiple rows, an empty optional row, and an unsafe row that requires a note.
- Add deterministic local expressions only. For example:
- Save and validate the offline structure. Resolve every offline capability warning before distributing the package.
- Download/prepare the tested version on a controlled device. Record the form version and field-work owner in the visit plan.
Capabilities intentionally unavailable offline
The offline form builder blocks features that require current server data or an online workflow. This is a safety boundary, not a missing configuration switch.
The offline validator can reject expressions that the general editor suggests. Treat that rejection as the contract for the form type; do not work around it with a different client-side expression.
Field workflow: from device to received session
Before departure
- Confirm the worker is signed in and has the intended assignment/scope while online.
- Prepare the current form package and check its version, title, repeatable bounds, required fields, and fixed option values.
- Test the device’s available storage, camera/file selection, battery plan, and time/date settings.
- Open a controlled non-production session, save a draft, attach a non-sensitive test file, submit it, and verify it reaches
syncedbefore relying on the device for live work. - Agree how the worker records the Citizen Service Request reference without placing personal data in an unsecured note or filename.
In the field
- Start or continue the local session and save meaningful progress as the visit proceeds.
- Add one Observation instance per actual observation. Keep individual notes and photos attached to the right row/field.
- Before submission, check mandatory fields, repeatable rows, and file names. A field labelled “optional” may still be required by an unsafe/specific local rule.
- Submit once when the inspection is complete. Note the local reference/time and retain the device until synchronization is confirmed.
When connectivity returns
- Connect the device and keep the app/session available.
- Watch the state move from
pendingtosyncing, then tosynced, or capture thefailederror and retry timing. - The client uploads each pending local file, replaces its local reference in saved state, starts the server session, and commits the saved state.
- Open the server-side form submission using the resulting session/reference and confirm observation rows, file attachments, timestamps, and required values.
- Only then let the Decision and Records Unit use the synchronized evidence in a review or status decision.

