# Normalize Worksheet

> Perform Normalize Worksheet through GenHealth.

Source: [https://genhealth.ai/docs/workflows/integrations/gen-health/genhealth_normalize_worksheet](https://genhealth.ai/docs/workflows/integrations/gen-health/genhealth_normalize_worksheet)

Integration: [GenHealth](https://genhealth.ai/docs/workflows/integrations/gen-health.md)

- Handler: `genhealth_normalize_worksheet`

## Inputs

- `document_id` — Document Id (expression)
  Optional literal value or workflow expression.
- `source_format` — Source Format (select)
  Optional selected identifier or value.
  Default: `"auto"`
  Options: Auto Detect ("auto"), CSV ("csv"), Excel (.xlsx) ("xlsx")
- `target_fields` — Target Fields (repeatable_group, required)
  Required list of structured items.
  - `key` — Key (text, required)
    Required text value.
  - `semantic_type` — Semantic Type (select, required)
    Required selected identifier or value.
    Default: `"text"`
    Options: Text ("text"), Currency ("currency"), Date ("date"), Identifier ("identifier")
  - `description` — Description (textarea, required)
    Required text value.
  - `required` — Required (boolean)
    Optional true-or-false value.
    Default: `"false"`
- `derived_fields` — Derived Fields (repeatable_group)
  Optional list of structured items.
  - `key` — Key (text, required)
    Required text value.
  - `source_field` — Source Field (text, required)
    Required text value.
  - `pattern` — Pattern (text, required)
    Required text value.
  - `match_group` — Match Group (number)
    Optional numeric value.
    Default: `1`

## Outputs

- `document_id` — Document Id
- `file_name` — File Name
- `source_format` — Source Format
- `sheet_name` — Sheet Name
- `columns` — Columns
- `raw_row_count` — Raw Row Count
- `count` — Count
- `rows` — Rows
- `schema` — Schema
- `message` — Message
- `error` — Error

Output schema completeness: `best_effort_declared`

## Safety

- External effect: `write`
- Confirmation recommended: no
- Retry safe: no
- Dry run supported: no

## Schemas

These schemas are first-pass authoring guidance. Runtime validation remains authoritative.

### Input schema

```json
{
  "type": "object",
  "required": [
    "target_fields"
  ],
  "properties": {
    "document_id": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "source_format": {
      "enum": [
        "auto",
        "csv",
        "xlsx"
      ],
      "type": "string",
      "default": "auto",
      "description": "Optional selected identifier or value.",
      "x-workflow-field-type": "select"
    },
    "target_fields": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "key",
          "semantic_type",
          "description"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Required text value.",
            "x-workflow-field-type": "text"
          },
          "required": {
            "type": "boolean",
            "description": "Optional true-or-false value.",
            "x-workflow-field-type": "boolean"
          },
          "description": {
            "type": "string",
            "description": "Required text value.",
            "x-workflow-field-type": "textarea"
          },
          "semantic_type": {
            "enum": [
              "text",
              "currency",
              "date",
              "identifier"
            ],
            "type": "string",
            "default": "text",
            "description": "Required selected identifier or value.",
            "x-workflow-field-type": "select"
          }
        },
        "additionalProperties": false
      },
      "description": "Required list of structured items.",
      "x-workflow-field-type": "repeatable_group"
    },
    "derived_fields": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "key",
          "source_field",
          "pattern"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Required text value.",
            "x-workflow-field-type": "text"
          },
          "pattern": {
            "type": "string",
            "description": "Required text value.",
            "x-workflow-field-type": "text"
          },
          "match_group": {
            "type": "number",
            "default": 1,
            "description": "Optional numeric value.",
            "x-workflow-field-type": "number"
          },
          "source_field": {
            "type": "string",
            "description": "Required text value.",
            "x-workflow-field-type": "text"
          }
        },
        "additionalProperties": false
      },
      "description": "Optional list of structured items.",
      "x-workflow-field-type": "repeatable_group"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "rows": {},
    "count": {},
    "error": {},
    "schema": {},
    "columns": {},
    "message": {},
    "file_name": {},
    "sheet_name": {},
    "document_id": {},
    "raw_row_count": {},
    "source_format": {}
  },
  "additionalProperties": true
}
```
