Skip to main content
Use dynamic_form_mapping_action when a form’s fields are not known at authoring time. The action extracts the field keys from the current page, POSTs them to your endpoint, and stores the returned mapping so a later agentic_task can fill the form.

Overview

  • Use when: Questionnaires, eligibility forms, or other pages whose labels change per run, and your backend already knows how to map those labels to values.
  • How it works: LLM extraction reads the page, Optexity POSTs the extracted keys (plus optional screenshot, axtree, and live-stream URL) to your endpoint, then waits for a JSON mapping in the HTTP response.
  • Next step: An agentic_task whose prompt references {form_values[0]} (or whatever you set as output_variable_name).
This action does not send the live browser session. Your endpoint receives JSON only.

Properties

Default before_sleep_time is 3.0 seconds and default end_sleep_time is 0.0, matching extraction actions.

JSON Example

Extraction Schema

extraction_format describes the keys you send to your endpoint, not the values that come back. Use one list or one object of lists — the same type-annotated dict as LLM extraction.
The extracted JSON is POSTed as extracted_fields with no extra transformation, so your mapper can key off whatever schema you defined.

Callback URL

callback_url is this action’s endpoint. It is separate from the task completion callback. url is SSRF-checked (no private/internal hosts). Redirects are not followed. {variable[0]} substitution works on all four fields.

Request Payload

Optexity POSTs JSON. Optional fields are present and set to null when disabled, so the schema is stable:
Turn screenshot sending off when your mapper only needs the extracted keys:

Response Contract

The HTTP response body is the mapping: a JSON object whose values are strings, numbers, or booleans. Nested objects, arrays, and null are rejected. Serialized size is capped at 64KB.
Optexity stores that body as a JSON string in a one-element list:
Use {form_values[0]} in later nodes. The variable is overwritten each time this action runs (including inside a loop). You do not need to declare form_values under generated_parameters. Non-2xx, redirect, non-JSON, invalid shape, oversized body, or a timeout raises DynamicFormMappingException and fails the task. Keep max_wait_time in the 30–60s range; values above 120s are rejected. This action holds one HTTP request — it is not a HITL-style poll, so it is not suitable for a human sitting on the live stream deciding values.

Filling the Form

Follow the mapping action with an agentic_task whose prompt includes the stored JSON:
See Agentic Tasks for max_steps and task phrasing.

Complete Example

Multiple Mappings

Set output_variable_name when two mapping actions run in the same automation so the second does not overwrite the first:
Then reference {patient_form_values[0]} in the matching agentic_task.