# Categorise with AI action settings

Source: https://govform.com/resources/documentation/article/25-25-action-ai-categorise
Topic: Action Settings

**In Govform Builder**

Your library → Services → Your service → Your page → Page actions → Your action → AI settings

Add **Categorise with AI** from **Page actions → Add action**. It selects one category from your list, or returns no match. It does not supply numeric scores, weights or several selected categories.

## Configure inputs and categories

Use the [shared AI text/image inputs and limits](<https://govform.com/resources/documentation/article/25-24-action-ai-summarise#shared-ai-inputs>). The stored action type is `aiCategorise`.

| Property | Meaning |
| --- | --- |
| `aiCategories` | Between 1 and 100 categories. |
| Category `id` | Unique, stable identifier, up to 100 characters. Conditions and integrations should use it. |
| Category `label` | Visible name, up to 200 characters. |
| Category `description` | Optional inclusion criteria, up to 1,000 characters. |

For example, a facilities service might define water/plumbing, heating/ventilation and access/doors. Describe their boundaries, and preserve each ID when improving its wording. Optional additional instructions can explain the handling of overlapping reports.

## Read match and no-match results

```
{{ actions.categoryAction.response.categoryId }}
{{ actions.categoryAction.response.categoryLabel }}
{{ actions.categoryAction.response.status }}
```

| Outcome | Result | Handle it by |
| --- | --- | --- |
| Matched | `status="matched"`, with the configured category ID and label. | Use the ID for a suggestion or route, with appropriate review. |
| No match | `status="no_match"`, `categoryId=null`, `categoryLabel="No matching category"`. | Provide a deliberate fallback. This is a successful result, not an action failure. |
| Processing failed | Normal action error and response code. | Use the service's failure route; do not treat it as a category. |

No-match results are chargeable on metered accounts like other successful AI results. Review AI suggestions against the original content; they do not establish eligibility or a staff decision.

## Save a category and control visibility

**In Govform Builder**

Your library → Services → Your service → Your page → Page actions → Your action → Add result to form

Use **Add result to form** for `response.categoryId`, `response.categoryLabel` or `response.status`. These are read-only calculated fields, with independent page, applicant-answer and review visibility. To ask someone to confirm a suggestion, collect their confirmation in a separate ordinary answer.

## Test the boundaries

**In Govform Builder**

Your library → Services → Your service → Your page → Page actions → Your action → Test AI

Test each category, multiple possible categories, vague/out-of-scope content, image-only input, combined input, no match and a failed call. User view is mocked; saved-settings Test AI is real, separate from other actions and uses account capacity. The shared 15-second deadline, input limits and charging rules are described in [Summarise with AI](<https://govform.com/resources/documentation/article/25-24-action-ai-summarise>).
