How to raise an OFS Flow Form with Pre-Filled Data
This article takes you through creating APIs that allow for the creation of an OFS-Flow alert, which contains pre-filled data populated by the API request itself.
Scenario
-
Form A (The Source): Line Setup Check. The operator records the
film_batch_numberand thetarget_pack_weight. -
Form B (The Destination): Hourly Quality Check. This form should automatically know the
film_batch_numberandtarget_pack_weightfrom the morning setup.
Step 1: Retrieve the Setup Data
Your system (or a middleware script) queries the OFS Alert Store to find the most recent Line Setup Check for that specific packaging line.
Query URL: https://{yourofsserver}/alertstore/query?limit=1&filter={"configUID":["setup-form-uid-123"]}
Action: From the JSON response, capture the values:
-
film_batch_number: "FB-99021" -
target_pack_weight: 500
Step 2: Construct the "Raise Alert" POST Request
Now, when it is time for the hourly check, you trigger a new alert using 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 and Send the Body
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
Step 4: Operator Experience
When the Hourly Quality Check pops up on the OFS-Go console:
-
The field "Film Batch ID" is already filled with FB-99021.
-
The field "Required Weight" is already filled with 500.
-
The operator only needs to enter the actual measured weight, saving time and preventing transcription errors.