# Function extractField

- extractField(data: Record<string, unknown>, fields: string[]): string

  Extracts a string value from the first matching field name.

  EP API JSON-LD responses sometimes return single-value fields as arrays (e.g. `inverse_decided_on_a_realization_of: ["eli/dl/event/..."]`). When the value is an array, the first element is used.

  #### Parameters

  - data: Record<string, unknown>

    Record to search

  - fields: string[]

    Field names to try in order

  #### Returns string

  String value from first matching field, or empty string

  - Defined in clients/ep/jsonLdHelpers.ts:51