Parse attachment

Trigger AI document parsing on a Smart Attachment field

Triggers AI document parsing on an uploaded file for a Smart Attachment field. Matching empty fields are auto-filled directly into the form store (respecting field permissions) — call form.toJSON() afterward to read the updated values.

Parameters

ParametersTypeDescription
instanceIdStringRequired.
activityInstanceIdStringRequired.
fieldIdStringRequired. Id of the Smart Attachment field.
fileObjectRequired. An uploaded file's metadata.

Syntax

const form = await processInstance.initForm();
const files = await kf.client.openFilePicker({ fileExtensions: ["pdf"], maxCount: 1 });
await form.updateField({ [fieldId]: files });
await processInstance.parseAttachment({
    instanceId: form.instanceId,
    activityInstanceId: form.activityInstanceId,
    fieldId,
    file: files[0]
});
const updated = await form.toJSON(); // other fields now auto-filled

Returns

Returns { appliedFields, suggestedBy }.

On this page