Skip to main content
The type tells anyformat what kind of value to expect, and shapes how it’s validated and stored. This page is the single source of truth for field types — it lists every type, its name in the UI and in the API, and how to use it well.

All field types at a glance

Field types
There is no separate list data_type. Use Multiselect (multi_select) for a list of values from a fixed set of options, and Object (object) for a list of structured rows (a subtable). For a free-form list of strings or numbers, model it as an Object with a single nested field.

Not sure which to pick?

A quick guide:
  • Is it a number with decimals, like a price or percentage? → Decimal number (float)
  • Is it a whole number, like a count or quantity? → Integer number (integer)
  • Is it a date without a time? → Date
  • Is it a yes/no answer? → Yes / No (boolean)
  • Does it have to be one value from a fixed list of options? → Select (enum)
  • Could it be several values from that list? → Multiselect (multi_select)
  • Is it a repeating table, like invoice line items? → Object (Subtable) (object)
  • Anything else (names, IDs, addresses, free text)? → Text (string)
Picking the right type matters: anyformat returns the value in that shape (a real number you can sum, a real date you can sort), and it helps the AI know what to look for.

Field definition

Every field requires at least:
  • name — Unique identifier (snake_case).
  • description — Clear explanation of what to extract. Used by the AI as guidance.
  • data_type — One of the types listed above.
Complex types (object, enum, multi_select) also take extra properties documented below.

Simple types

Best for: Values that vary widely (company names, addresses).Watch out for: Don’t use if values are from a known list — use Select instead.
Best for: Calendar dates when time isn’t relevant. Returned as YYYY-MM-DD.Watch out for: If time appears in the document, prefer Date & time.
Best for: Precise timestamps when documents include a time, not just a date. Returned in a standard format like 2024-03-15T10:30:00Z.Watch out for: Timezones and unusual date formats can be ambiguous — add an instruction if the document’s format is unusual.
Best for: Money, percentages, measurements.Watch out for: Avoid if values should be whole numbers.
Best for: Counts, quantities, item numbers.Watch out for: Not suitable for currency.
Best for: Clear true/false questions (Is paid? Is signed?).Watch out for: Avoid vague cues like “maybe” or “often” — make instructions explicit.

Select (enum)

Use enum when the extracted value must be one of a predefined set of options. The field requires an enum_options array.
If no option matches the document, the field value is null. Why use Select:
  • Enforces consistency
  • Avoids spelling variations
  • Makes analytics and filtering reliable
Best practices:
  • Keep options short and unambiguous
  • Provide clear descriptions for each option
  • Avoid overlapping meanings
  • Prefer Select over Text when values repeat

Multiselect (multi_select)

Same shape as enum, but the field can return multiple matched options as an array.
Returns an array of strings:

Select vs. Multiselect


Object / Subtable (object)

Use object to extract a structured group of properties. Object fields require a nested_fields array. Only one level of nesting is supported: the children of an object field must be non-object types (string, integer, float, date, datetime, boolean, enum, multi_select). An object field cannot contain another object field as a child.

Single nested object

Repeating rows (Subtable)

Object fields also capture repeating tabular data — invoice line items, transaction rows, anything that’s a list of “things with the same structure”.
Each row in the document becomes one object in the resulting array. Use Object when:
  • You see the same set of fields repeating
  • The document contains a list/table where each row is one “item”
  • You need a structured value per row (not a blob of text)
Best practices:
  • Keep subtable fields minimal at first (3–5 columns)
  • Use clear row-level instructions: “Extract one row per item. Ignore headers and totals.”
  • Add shared fields like currency at the top level, not inside each row
  • Start with the most reliable columns first (description + amount), then expand
Object field
Common mistakes:
  • Using Object for a single nested group (like a “vendor address”). If it’s not repeating, it’s fine — but consider whether top-level fields would be simpler.
  • Making the subtable too wide too early (10+ columns increases ambiguity).
  • Nesting an Object inside another Object. Only one level of nesting is supported — object children must be non-object fields.

Complete example

A workflow definition that uses several field types together:

Tips for better results

  1. Be specific in descriptions. “The invoice number, usually starting with INV-” beats “Invoice number”.
  2. Use appropriate types. float for amounts, date for dates — not string.
  3. Keep field names consistent. snake_case throughout.
  4. Describe location only when helpful. “Total amount shown at the bottom right” can disambiguate, but the AI usually doesn’t need it.

What’s next?

Fields

The three properties every field has

Instructions

Write better extraction instructions