> For the complete documentation index, see [llms.txt](https://docs.acpt.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.acpt.io/developers/functions/get_acpt_child_field.md).

# get\_acpt\_child\_field

Fetch a nested field value from a Repeater field

Fetch a nested field value from a Repeater field row.

### Usage

```php
$value = get_acpt_child_field([
    'post_id'           => 123,
    'box_name'          => 'box',
    'field_name'        => 'child_field',
    'parent_field_name' => 'repeater_field',
    'index'             => 0,
]);
```

### Parameters

| Parameter              | Type              | Required                 | Description                                                                                        |
| ---------------------- | ----------------- | ------------------------ | -------------------------------------------------------------------------------------------------- |
| `post_id`              | integer           | Conditional              | The post ID                                                                                        |
| `term_id`              | integer           | Conditional              | The term ID                                                                                        |
| `user_id`              | integer           | Conditional              | The user ID                                                                                        |
| `comment_id`           | integer           | Not currently functional | Accepted, but see warning below                                                                    |
| `wc_product_attribute` | integer           | Conditional              | The WooCommerce product attribute ID                                                               |
| `option_page`          | string            | Conditional              | The option page slug                                                                               |
| `box_name`             | string            | Required                 | The meta box name                                                                                  |
| `field_name`           | string            | Required                 | The child field name                                                                               |
| `parent_field_name`    | string            | Required                 | The parent Repeater field name. Also accepted as `parentFieldName`                                 |
| `index`                | string \| integer | Required                 | Zero-based row index. Use dot notation (e.g. `0.1`) to reach a row nested inside a nested Repeater |
| `with_context`         | boolean           | Optional                 | Wrap the returned value in a `{before, value, after}` object                                       |
| `format`               | string            | Optional                 | `only_value` (default) or `complete`                                                               |
| `return`               | string            | Optional                 | `object` (default) or `raw`                                                                        |

Exactly one of `post_id`, `term_id`, `user_id`, `option_page`, or `wc_product_attribute` must be provided to identify the location.

{% hint style="warning" %}
`comment_id` is accepted without a validation error, but is currently **not** wired to any location resolution in this function — passing only `comment_id` returns `null`. Use `post_id`/`term_id`/`user_id`/`option_page`/`wc_product_attribute` instead.
{% endhint %}

### Return

| Type    | Description                                               |
| ------- | --------------------------------------------------------- |
| `mixed` | The child field value in its native PHP type              |
| `null`  | If the field or the row at the given index does not exist |
