> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.ai.foundry.TransformTextToJSON

- Component: `appmixer.ai.foundry.TransformTextToJSON`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.ai.foundry 1.0.0](https://connectors.appmixer.com/connector/appmixer.ai.foundry/1.0.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.ai.foundry/1.0.0/component/appmixer.ai.foundry.TransformTextToJSON>

Extract structured JSON data from text using AI.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Text (`text`) | textarea | The text from which to extract structured JSON data. Example: `John is 25 years old.`. |
| Output JSON Schema (`jsonSchema`) | textarea | The schema that defines the structure of the output JSON. Use [JSON Schema format](https://json-schema.org/). Example: `{"type":"object","properties":{"name":{"type":"string"}, "age":{"type":"number"}}}`. It must be a valid JSON schema and must be of "type": "object". If you want to produce an array, you can nest the array under an object property of type array. Example: `{"type":"object","properties":{"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"age":{"type":"number"}}}}}}`. |
| Deployment (`model`) | text | Name of the model deployment in your Azure AI Foundry resource (Deployments in the Foundry portal), e.g. `gpt-4o-prod`. The list offers the models known to the resource; when your deployment name differs from the model name, type the deployment name. |

## Output ports

### Port `out`

Variables are loaded dynamically from `/component/appmixer/ai/foundry/TransformTextToJSON?outPort=out&ignoreAuth=true`.

## Full metadata (component.json)

```json
{
  "name": "appmixer.ai.foundry.TransformTextToJSON",
  "author": "Appmixer <info@appmixer.com>",
  "description": "Extract structured JSON data from text using AI.",
  "auth": {
    "service": "appmixer:ai:foundry"
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "jsonSchema": {
            "type": "string"
          },
          "model": {
            "type": "string"
          }
        },
        "required": [
          "model",
          "text",
          "jsonSchema"
        ]
      },
      "inspector": {
        "inputs": {
          "text": {
            "label": "Text",
            "type": "textarea",
            "index": 1,
            "tooltip": "The text from which to extract structured JSON data. Example: <code>John is 25 years old.</code>."
          },
          "jsonSchema": {
            "label": "Output JSON Schema",
            "type": "textarea",
            "index": 2,
            "tooltip": "The schema that defines the structure of the output JSON. Use <a target=\"blank\" href=\"https://json-schema.org/\">JSON Schema format</a>. Example: <code>{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"}, \"age\":{\"type\":\"number\"}}}</code>. It must be a valid JSON schema and must be of \"type\": \"object\". If you want to produce an array, you can nest the array under an object property of type array. Example: <code>{\"type\":\"object\",\"properties\":{\"contacts\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"age\":{\"type\":\"number\"}}}}}}</code>."
          },
          "model": {
            "type": "text",
            "index": 3,
            "label": "Deployment",
            "tooltip": "Name of the model deployment in your Azure AI Foundry resource (Deployments in the Foundry portal), e.g. <code>gpt-4o-prod</code>. The list offers the models known to the resource; when your deployment name differs from the model name, type the deployment name.",
            "source": {
              "url": "/component/appmixer/ai/foundry/ListModels?outPort=out",
              "data": {
                "properties": {
                  "isSource": true
                },
                "transform": "./ListModels#toSelectOptions"
              }
            }
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "source": {
        "url": "/component/appmixer/ai/foundry/TransformTextToJSON?outPort=out&ignoreAuth=true",
        "data": {
          "properties": {
            "generateOutputPortOptions": true
          },
          "messages": {
            "in/model": "dummy",
            "in/text": "dummy",
            "in/jsonSchema": "inputs/in/jsonSchema"
          }
        }
      }
    }
  ],
  "icon": "(data URI omitted)",
  "version": "1.0.0"
}
```
