Skip to content
  • There are no suggestions because the search field is empty.

How to raise an OFS Flow form with pre-filled data

Use the OFS APIs to raise a form that already contains data captured earlier, so operators confirm figures rather than re-typing them.

What you'll build

  • A read from the Alert Store that pulls values out of a form an operator already completed.
  • A call to the alertraise API that raises a second form with those values already in its fields.

The scenario

Two forms, one feeding the other:

  • Form A, the source — Line Setup Check. At the start of the run the operator records the film batch number and the target pack weight.
  • Form B, the destination — Hourly Quality Check. This form should already know the film batch number and target pack weight from the morning's setup, so the operator only enters the measured weight.

The work happens in your own system or a middleware script between the two. OFS provides the read and the raise; the joining up is yours.

Before you start

  • The account making these calls needs the alertraise permission. Administrator and Analytics User with Editor both carry it.
  • The Alert Store uses basic authentication with OFS login credentials, not the session cookie used elsewhere in OFS.
  • You will need the API Key from the source form's General tab, and your organisation's Alerts Shard Key from Advanced Settings > Organisations.

Step 1 — Retrieve the setup data

Query the Alert Store for the most recent Line Setup Check on that packaging line:

https://<yourofsserver>/alertstore/query?limit=1&filter=<url-encoded JSON>

The filter is a JSON object, URL-encoded and passed as a query parameter:

{"configUID": ["<AlertsShardKey>:<APIExportKey>"]}

configUID identifies which form to read from, and is the two parts joined with a colon — your organisation's Alerts Shard Key, then the form's API Key.

Always send a filter and a limit. Without both, the call returns every alert ever raised on the server, which can destabilise the software.

From the JSON response, capture the values you need:

  • film_batch_number: FB-99021
  • target_pack_weight: 500

Step 2 — Build the raise request

When the hourly check is due, raise the destination form with the alertraise API:

Base URL: https://{hostname}/serviceengine/alertraise?configUID={Hourly_Check_UID}&workcentre={Line_ID}&time={timestamp}

  • configUID: The UID for the "Hourly Quality Check" form.

  • workcentre: e.g., PACK-LINE-04.

  • time: Current Unix Epoch (e.g., 1705910400000).

Step 3 — Map the fields and send the body

Send the captured values as the body of the request.

You must send the captured data as the body of your request. The key names must match the Unique Field Names in Fusion Manager for the Hourly Quality Check form.

Content-Type: application/x-www-form-urlencoded

Body Content: film_batch_id=FB-99021&required_weight=500


Test it

Raise the form once by hand and watch it arrive on the console.

  • The field Film Batch ID should already contain FB-99021.
  • The field Required Weight should already contain 500.
  • The operator only has to enter the measured weight.

If the form arrives with empty fields, the body keys do not match the destination form's Unique Field Names. If no form arrives at all, check the account's permissions and the alert's Groups filter on that console — a form can raise correctly and still never pop up if its Alert Group is not ticked on the console.

Adapting it to your own forms

  • Any field type that accepts a typed value can be pre-filled this way. Work out the Unique Field Names first, then build the body around them.
  • Where the source data is not in OFS at all — an ERP batch number, a lab result — the same raise call works. Only Step 1 changes.
  • Keep the filter out of public URL-encoding websites. It contains the configUID, which embeds your form's API key. URL-encoding can be done locally in a browser console with encodeURIComponent.