Skip to main content
Quick summary
After you create a Form filling session, call setFormFillingContext with Suki templates and/or partner schemas (schema as a JSON object string on iOS). Record with the same start, pause, and resume controls as Ambient. End with endFormFillingSession() or end(), then call getFormFillingStructuredData(for: recordingId). Optionally submit submitFormFillingFeedback with generatedValues[].id.
This guide covers what you do after create: set which forms to fill, record the visit, end the session, retrieve structured form data for your review UI, and submit optional feedback.
You need an active Form filling session and a stored recordingId from create. Refer to Create Form filling session first.
What will you learn? In this guide, you will learn how to:
  • Set form context with setFormFillingContext using Suki templates, partner schemas, or both.
  • Record with start, pause, and resume, then end with endFormFillingSession() or end().
  • Retrieve filled and unfilled forms with getFormFillingStructuredData(for:).
  • Submit optional Form filling feedback with submitFormFillingFeedback.
  • Handle Form filling events, offline behavior, and context or retrieve errors.

Set Form filling context

After you create a Form filling session, call setFormFillingContext(with:onCompletion:) to tell Suki which forms to fill. You can call it anytime after create and before end, including after start. You can call it again to update the forms.
  • Calling it on an Ambient session returns noSessionExist.
  • Calling setSessionContext on a Form filling session returns noSessionExist.
  • values must be non-empty. An invalid shape returns invalidContext.

Context parameters

dictionary
required
Top-level Form filling context object. String key: "form_filling".

Static and dynamic entries

Each item in values must use exactly one mode: a static Suki template or a dynamic partner schema. Never both fields on the same entry, and never neither. One call may mix static and dynamic entries in the same values array.
On iOS, schema must be a JSON object string, not a nested Swift dictionary. Serialize your schema object to a string before you put it in context.

Example entries

Swift
For schema field rules and MedicalFormType names, refer to Dynamic Form filling. For Suki catalogue IDs, refer to Form filling templates.

Record and end

Form filling uses the same recording controls as Ambient. Call start, pause, and resume the same way you do for an ambient session. Refer to Recording controls for the full workflow. When the visit is done, end the Form filling session so Suki can generate the form field values.
  • endFormFillingSession(): Prefer this for Form filling. It checks that the active session is Form filling, then calls end(). Calling it during an Ambient session returns noSessionExist.
  • end(): Also ends an active Form filling session.
  • cancel(): Discards the audio and produces no form output.

Retrieve structured data

After you end the session, call getFormFillingStructuredData(for:) with the recordingId you stored from create. Use the result to drive your form review UI. There is no Form filling status() API. After end, poll this method or use a Partner webhook. Do not use Ambient content, transcript, getStructuredData, or listEncounterNotes for this workflow.

Structured data response

A successful getFormFillingStructuredData(for:) call returns structuredData with two lists: forms that have filled values, and forms that do not yet.
array
Forms that have filled field values. Show these as completed in your form review UI.
array
Forms that have no filled output yet. These often include only formTemplateId. Show them as not filled.
Each instance can include:
string
Suki instance id for this form result. Use this value as formId when you submit Form filling feedback.
string
Match this to a static Suki template you sent in context.
string
Match this to the Context id you sent on a dynamic entry.
string
Form type when present.
string
Display title when present. Optional display matching.
string
Instance status when present.
dictionary
Filled field values as [String: Any].
string
Patient id when present.
string
Correlation id for the session when present.
string
Creation timestamp when present.

Map results to the forms you sent

When structured data returns, each item is one form result. Use these fields to connect that result back to the form you put in setFormFillingContext. Do not rely on array order. The list order can differ from the order you sent.

Submit Form filling feedback

After a clinician reviews the filled forms, call submitFormFillingFeedback to send a rating and optional comments. Pass the Suki instance id from generatedValues[].id as formId, and use the same recordingId from create. Rating rules match Ambient QuantitativeFeedback. This call requires network. Use submitFormFillingFeedback for forms. Do not use Ambient submitFeedback.
string
required
Suki instance id from generatedValues[].id.
QuantitativeFeedback
required
Rating object with minRating, maxRating, and rating. Same rules as Ambient QuantitativeFeedback.
string
Optional free-text comments.

Session events

Use the same SukiAmbientSessionDelegate for Form filling recording events: .started, .paused, .resumed, .ended, .cancelled, and .convertedToOfflineSession. Refer to Session events and delegates.
Do not use .suggestionsGenerated or .suggestionsGenerationFailed for form-ready UI. Those are Ambient note events. Use structured data or a webhook instead.

Offline

Form filling uses the same offline path as Ambient. After a short reconnect buffer, the SDK emits .convertedToOfflineSession, keeps recording with encrypted local audio, and uploads automatically when the network returns. Refer to Offline mode for the full workflow. Encounter queueing also matches Ambient. The encounter key is the Form filling correlationId (the same key as the Ambient session group). If an unfinished offline session already exists for that key, the next create on the same key also goes offline. Uploads for that encounter run oldest first, so a queued Form filling session is sent before a later Ambient session on the same appointment.

Errors to handle

Handle these errors when you set context, end the session, or retrieve results. Create-time errors such as sessionInProgress and remoteSessionConflict(blockingSessionId:) are covered in Create Form filling session. For more error detail, refer to Error messages.

Complete code example

The following example shows a happy path where you create a Form filling session, set a Suki template, start recording, end the session, and retrieve structured data. Store recordingId from create so you can pass it into retrieve after the visit.
You can also call setFormFillingContext after start(), any time before end.

Next steps

Refer to Form filling templates for Suki catalogue form_template_id values. Refer to Dynamic Form filling for XOR rules and partner schemas. Refer to Create Form filling session if you still need create and recordingId. Refer to Recording controls for start, pause, and resume. Refer to Error messages for SukiAmbientCoreError cases.
Last modified on September 29, 2026