> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arc.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# arc:first

> Executes a block of script only during the first iteration of arc:call or arc:enum, useful for generating headings or inspecting the first item of a feed.

export const siteNameShort = "Arc";

Use the `arc:first` keyword to execute a section of a script for only the first iteration of an [arc:call](./op-arc-call) or [arc:enum](./op-arc-enum) keyword. It is a convenient way to generate headings or to inspect the first item of a feed before going through the rest of the feed.

During the first iteration, the `arc:first` body executes before any other code within the `arc:call` or `arc:enum`, regardless of where the `arc:first` is located in the `arc:call` or `arc:enum` body. Therefore, CData recommends that you place `arc:first` at the top of the `arc:call` or `arc:enum` body.

If the scope has no items, neither `arc:first` nor [arc:last](./op-arc-last) is executed.

## Parameters

None

## Control Attributes

None

## Example

Create an HTML table from a feed where each item is represented as a row:

```xml theme={null}
<arc:call op="listCustomers">
  <arc:first>
    <table>
    <thead>
      <arc:enum item="customer">
        <td>[_attr]</td>
      </arc:enum>
    </thead>
  </arc:first>
    <tr>
      <arc:enum item="customer">
        <td>[_value]</td>
      </arc:enum>
    </tr>
  <arc:last>
    </table>
  </arc:last>
</arc:call>
```

## See Also

* [arc:last](./op-arc-last): Execute a code block only for the last iteration.
