> ## 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:last

> Use arc:last to execute a code block only after the last item is encountered in a feed returned by arc:call or arc:enum.

export const siteNameShort = "Arc";

{siteNameShort}Script keywords within the scope of the `arc:last` keyword are only executed after the last item is encountered, and only if items were returned by [arc:call](./op-arc-call) or [arc:enum](./op-arc-enum).

An `arc:last` statement is executed only after the last item is processed; it maintains access to the last item in the feed. If the scope has no items, neither [arc:first](./op-arc-first) nor `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:first](./op-arc-first): Execute a code block only for the first iteration.
