# Field()

Returns a specific field from a data row in Marketing Cloud Engagement or a record in Marketing Cloud Next.

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>✅ Yes</td>
  </tr>
</table>

This function became available in Marketing Cloud Next during the Summer ’26 release (API version 67.0).

## Syntax

```
Field(row, fieldName, boolExceptionIfNotFound)
```

The `Field()` function has three parameters:

- `row` (string): Required. The row object that contains the field that you want to return.
- `fieldName` (string): Required. The name of the field to return from the row.
- `boolExceptionIfNotFound` (boolean): If `true`, the function returns an exception if the specified field doesn’t exist. If `false`, the function returns an empty string if the field doesn’t exist. The default value is `true`.

## Usage

To use the function, pass it a row and the name of the field from that row that you want to return. This example sets the value of `@field` to the value of the field "FieldName" from the first row of the rowset contained in the @rowset variable.

```
%%[
  Set @field = Field(Row(@rowset, 1), "FieldName")
]%%
```

Combine the `Field()` function with the `Row()` function to output a specific piece of data from the specified row. This example creates a rowset from JSON data. The `Row()` function retrieves the first row from the rowset. The `Field()` function retrieves the value of the "Price" attribute from the first row.

```
%%[
  Set @json = '
  {
    "Flights": [
      {
        "Origin": "IND",
        "Dest": "NYC",
        "Price": 100.0,
        "PerBagSurcharge": "N/A"
      },
      {
        "Origin": "IND",
        "Dest": "LAX",
        "Price": 200.0,
        "PerBagSurcharge": "Free"
      },
      {
        "Origin": "IND",
        "Dest": "SEA",
        "Price": 500.0,
        "PerBagSurcharge": 25
      }
    ]
  }'
  Set @rowset = BuildRowsetFromJSON(@json, "$.['Flights'][*]", true)
  Set @row = Row(@rowset, 1)
  Set @field = Field(@row, "Price", 0)
  Output(v(@field))
]%%
```

The function outputs `100`.

## See Also

- [Row()](/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-row.md)
