Font Size:
Ask Joget AI

Store to Form Enhancer

Introduction

The Store to Form enhancer allows you to store the AI-generated response into a Joget form, so the AI-generated content becomes a permanent, searchable part of your app's data. It supports both simple text and structured JSON formats, enabling integration with existing form records or multi-row form tables.

Before you start
The target form must already exist in the same Joget app. The agent must be configured with an LLM and at least one task that produces output. 

What it does

Store to Form runs immediately after an agent task finishes and writes the output into a form record. It supports three storage strategies:

Single Field writes the raw response as plain text into one field on an existing record. You specify the field and the record ID. Use this when the output is a free-text value: an email draft, a summary, a recommendation.

JSON Manual Mapping parses the response as a structured JSON object and maps individual JSON keys to form fields using a Field Mapping grid you configure. This handles multi-row scenarios: if the JSON contains an array, the enhancer inserts one form row per array element using the Base JSON Object and Primary Key settings.

JSON Auto Mapping parses the response as a JSON object and writes the values into form fields automatically, using the JSON keys as field IDs. If the optional Fields to Fill grid is configured, only those fields are mapped, and a plain-language description for each field is exposed to the LLM as a hint. If the grid is left empty, every key in the JSON object is auto-mapped to the matching form field. This mode inserts or updates a single record.

In all modes, the enhancer calls Joget's form data service to persist the record. If the record ID is left blank, it falls back to the current workflow process ID.

When to use it

Use Store to Form when all of the following are true:

  • The agent output must be saved and retrievable after the agent run ends.
  • The destination is a Joget form in the same app.
  • You need the data in reports, datalists, or downstream workflow steps.

Typical scenarios include the following:

CRM (AI Email Draft): An agent writes a personalised follow-up email. Store to Form saves the draft into the CRM ticket record so an agent can review it before sending.
HR (Appraisal Summary): An agent summarises a performance review. Store to Form writes the summary into the appraisal form for the manager to approve.
Procurement (Bulk Action Items): An agent extracts a list of action items from a meeting transcript as JSON. Store to Form inserts each item as a separate row in the action items form.
 

When not to use it

Get started

How to use it

To use the Store to Form Element:

Adding the Store to Form enhancer

  1. Locate the Store to Form element under the Enhancers section of the palette.
  2. Drag and drop the element into the Drop an enhancer to here section.

Configure Form Properties

Fields to configure:

  • Store to Form: (Required) The target form that will receive the data. Choose a form from the dropdown. Only forms in the current app are listed.
  • Storage Strategy: (Required) Which mode to use for writing the output.    
    • Single Field: For plain text.
    • JSON Manual Mapping: For structured or multi-row data with explicit field mapping.
    • JSON Auto Mapping: For automatic key-to-field mapping.

Single Field mode

These fields appear only when Storage Strategy is set to Single Field:

  • Field Id: (Required) The form field that receives the agent output. Choose the field from the dropdown, filtered to the selected form.
  • Record ID: Which existing record to update. A record ID or a hash variable such as #processId#. Leave blank to use the current workflow process ID.

JSON Manual Mapping mode

These fields appear only when Storage Strategy is set to JSON Manual Mapping:

  • Base JSON Object: The key in the JSON whose value is the array of rows to insert. The array key name, for example items. Leave blank for a single-row insert.
  • Primary Key: The JSON field name used as each row's record ID. A JSON key name. Defaults to id. Leave blank to auto-generate a UUID per row.
  • Field Mapping: Maps each form field to a JSON key. One row per field: the form field in the left column, the JSON key name in the right column.
Field Mapping is required in practice

If Field Mapping is left empty, no fields are written. Add at least one mapping row.

JSON Manual Mapping: bulk-insert action items:

Response from agent:
{"items": [{"title": "Review contract", "owner": "Sara"}, {"title": "Send invoice", "owner": "Ali"}]}

Store to Form settings:
  Store to Form: action_items
  Storage Strategy: JSON Manual Mapping
  Base JSON Object: items
  Primary Key: (blank, auto-generate UUID per row)
  Field Mapping:
    title -> title
    owner -> owner

Result: two new rows inserted into the action_items form.

JSON Auto Mapping mode

These fields appear only when Storage Strategy is set to JSON Auto Mapping:

  • Record ID: Whether to insert a new record or update an existing one. Leave blank to insert (falls back to workflow process ID if inside a workflow), or enter a record ID or hash variable such as #processId#. If the JSON response contains an id key, its value takes precedence as the record ID.
  • Fields to Fill: Which form fields the AI should populate, and a plain-language hint for each. One row per field: Field ID in the left column, Description (hint for AI) in the right column. Leave the grid empty to auto-map every key from the JSON response.
How JSON Auto Mapping handles the record ID

The resolved record ID follows this precedence: (1) the id key in the JSON response, (2) the Record ID field value, (3) the current workflow process ID. If none of these resolves to a value, a new record is inserted with a system-generated ID.

JSON Auto Mapping with a configured Fields to Fill grid:

Store to Form settings:
  Store to Form: invoice
  Storage Strategy: JSON Auto Mapping
  Record ID: (blank, insert new record)

  Fields to Fill:
    Field ID: vendor_name    | Description: Name of the supplier company
    Field ID: invoice_number | Description: Unique invoice reference number
    Field ID: amount         | Description: Total invoice amount as a number
    Field ID: currency       | Description: Three-letter currency code, e.g. AED or USD

Expected LLM response:
{
  "vendor_name": "Acme Supplies LLC",
  "invoice_number": "INV-2024-042",
  "amount": "12500",
  "currency": "AED"
}

Result: a new invoice record is inserted with all four fields populated.

Tips and gotchas

  • JSON Auto Mapping requires a strict JSON object. The response must start with { and end with }. If the LLM wraps the JSON in prose or a code fence, add JSON Extractor before Store to Form. A non-object response throws an error and stops the task.
  • JSON Manual Mapping errors are silent. If the response is not valid JSON in JSON Manual Mapping mode, the enhancer logs an error and writes nothing, with no visible failure in the agent UI. Pair JSON Extractor before Store to Form when the LLM might include prose around the JSON.
  • JSON keys must match form field IDs exactly in JSON Auto Mapping. A key named vendorName does not write into a field with ID vendor_name. Use the Fields to Fill descriptions to guide the LLM to use the exact field IDs.
  • The Fields to Fill description is a prompt hint, not a mapping rule. The description column in JSON Auto Mapping is exposed to the LLM to help it produce the right values; the actual field matching is still done by JSON key name.
  • Single Field mode requires an existing record. If the record ID does not resolve to a real form record, nothing is written. Confirm the record exists before the agent runs, or rely on an active workflow process to supply the fallback ID.
  • Hash variables work in Record ID. You can reference workflow variables such as #processId# directly in the Record ID field for all modes that show it.
  • Pair with Form Data Schema for JSON Auto Mapping. The Form Data Tables Schema Prompt injects the form's field list into the system prompt automatically, so the LLM learns the expected key names without you hard-coding them in a text prompt.
Created by Gabriel Last modified by Debanraj Ravindran on Oct 11, 2026