---
title: "Child records configuration"
manual: "External Import"
version: "main"
permalink: "https://docs.typo3.org/permalink/cobweb/external_import:administration-children@main"
source: "Administration/Children/Index.rst"
rendered: "2026-10-10T09:03:14+00:00"
---

# Child records configuration {#administration-children}

The "children" property is used to create nested structures, generally
MM tables where additional information needs to be stored.

> [!NOTE]
> This corresponds to [inline-type ("IRRE") fields](https://docs.typo3.org/m/typo3/reference-tca/14.3/en-us/ColumnsConfig/Type/Inline/Index.html#columns-inline)
> with MM tables having a primary key field ("uid").

See the [Mapping data](https://docs.typo3.org/permalink/cobweb/external_import:user-mapping-data@main) chapter for an overview of import
scenarios which may help understand this feature. Also check out the
[Substructures and child records](https://docs.typo3.org/permalink/cobweb/external_import:import-configuration-examples-substructure-children@main)
example which shows the combined usage of "children" and "substructureFields" properties.

**Example:**

```php
$GLOBALS['TCA']['tx_externalimporttest_product']['columns']['pictures']['external'] = [
   'base' => [
        'field' => 'Pictures', // remote db field
        'transformations' => [
            10 => [
                'userFunction' => [
                    'class' => \Cobweb\ExternalImport\Transformation\ImageTransformation::class,
                    'method' => 'saveImageFromUri',
                    'parameters' => [
                        'storage' => '1:importedpictures', // local folder for files
                    ]
                ]
            ]
        ],
        'children' => [
            'table' => 'sys_file_reference',
            'columns' => [
                'uid_local' => [
                    'field' => 'pictures'
                ],
                'uid_foreign' => [
                    'field' => '__parent.id__'
                ],
                'title' => [
                    'field' => 'picture_title'
                ],
                'tablenames' => [
                    'value' => 'tx_externalimporttest_product'
                ],
                'fieldname' => [
                    'value' => 'pictures'
                ],
            ],
            'sorting' => [
                'source' => 'picture_order',
                'target' => 'sorting_foreign'
            ],
            'controlColumnsForUpdate' => 'uid_local, uid_foreign, tablenames, fieldname',
            'controlColumnsForDelete' => 'uid_foreign, tablenames, fieldname'
        ]
       ...
   ]
]
```

## Properties {#administration-children-properties}

| Property | Data type | Step/Scope |
| --- | --- | --- |
| [columns](https://docs.typo3.org/permalink/cobweb/external_import:columns@main) | array | Store data |
| [controlColumnsForUpdate](https://docs.typo3.org/permalink/cobweb/external_import:controlcolumnsforupdate@main) | string | Store data |
| [controlColumnsForDelete](https://docs.typo3.org/permalink/cobweb/external_import:controlcolumnsfordelete@main) | string | Store data |
| [disabledOperations](https://docs.typo3.org/permalink/cobweb/external_import:disabledoperations@main) | string | Store data |
| [sorting](https://docs.typo3.org/permalink/cobweb/external_import:sorting@main) | array | Store data |
| [table](https://docs.typo3.org/permalink/cobweb/external_import:table@main) | string | Store data |

### table {#administration-children-properties-table}

-   **Type**

    string

-   **Description**

    Name of the nested table. This information is mandatory.

-   **Scope**

    Store data

### columns {#administration-children-properties-columns}

-   **Type**

    array

-   **Description**

    List of columns (database fields) needed for the nested table. This is an
    associative array, using the column name as the key. Then each column must
    have one of two properties:

    -   **value**

        This is a simple value that will be used for each entry into the nested table.
        Use it for invariants like the "tablenames" field of a MM table.

    -   **field**

        This is the name of a field that is available in the imported data. The value
        is copied from the current record. Note that such fields can be any of the mapped
        columns, any of the [additionalFields](https://docs.typo3.org/permalink/cobweb/external_import:administration-additionalfields@main) or
        any of the [substructureFields](https://docs.typo3.org/permalink/cobweb/external_import:administration-columns-properties-substructure-fields@main).

        The special value `__parent.id__` refers to the primary key of the current
        record and will typically be used for "uid_local" or "uid_foreign" fields in MM
        tables, depending on how the relation is built.

-   **Scope**

    Store data

### controlColumnsForUpdate {#administration-children-properties-control-columns-for-update}

-   **Type**

    string

-   **Description**

    Comma-separated list of columns that need to be used for checking if a child record
    already exists. All these columns must exist in the list of [columns](https://docs.typo3.org/permalink/cobweb/external_import:administration-children-properties-columns@main)
    defined above. Defining this property ensures that existing relations are updated
    instead of being created anew.

    This list should contain all columns that are significant for identifying a child
    record without ambiguity. In the example above, we have:

    ```php
    'controlColumnsForUpdate' => 'uid_local, uid_foreign, tablenames, fieldname',
    ```

    These are all the columns that need to be queried in the "sys_file_reference" table to be sure
    that we are targeting the right record in the database. Any missing information might mean retrieving
    another record (for a different table or field, or whatever).

    > [!NOTE]
    > If this property is not defined, all children records will be considered to be new.
    > If [controlColumnsForDelete](https://docs.typo3.org/permalink/cobweb/external_import:administration-children-properties-control-columns-for-delete@main)
    > is defined and the "delete" operation is not [disabled](https://docs.typo3.org/permalink/cobweb/external_import:administration-children-properties-control-columns-for-disabled-operations@main),
    > all existing child relations will be deleted upon each import.

-   **Scope**

    Store data

### controlColumnsForDelete {#administration-children-properties-control-columns-for-delete}

-   **Type**

    string

-   **Description**

    This is similar to [controlColumnsForUpdate](https://docs.typo3.org/permalink/cobweb/external_import:administration-children-properties-control-columns-for-update@main)
    but for finding out which existing relations are no longer relevant and need to be
    deleted. It is not the same list of fields as you need to leave out the field
    which references the relation on the "other side". In the case of "sys_file_reference",
    you would leave out "uid_local", which is the reference to the "sys_file" table.

    > [!NOTE]
    > If this property is not defined, existing children records will not be checked and thus
    > never be deleted.

-   **Scope**

    Store data

### sorting {#administration-children-properties-sorting}

-   **Type**

    array

-   **Description**

    External Import stores child records in the order in which they appear, which is generally
    the order in which they are in the external data source. It may be needed to sort the child
    records differently, according to some other data available in the in the external source.

    This property allows this. It is defined by two elements:

    -   **source**

        The name of the column containing the sorting value in the external data source.
        This column should ideally contain numerical values. If that is not the case, the values
        are cast to integer when they are used, so you need to make sure that the values contained
        in this column can be cast safely.

        If the sorting value is missing for some records, a value of `0` will be used
        instead, putting those child records at the top of the list.

    -   **target**

        The name of the sorting field in the child record table.

    Both elements are mandatory. Configuration validation will fail otherwise.

    ```php
    'sorting' => [
        'source' => 'picture_order',
        'target' => 'sorting_foreign'
    ],
    ```

-   **Scope**

    Store data

### disabledOperations {#administration-children-properties-control-columns-for-disabled-operations}

-   **Type**

    string

-   **Description**

    Comma-separated list of operations which should not take place. This can be "insert"
    (no new child records), "update" (no update to existing child records) and/or
    "delete" (no removal of existing child records).

    > [!NOTE]
    > This applies only when a parent record is being updated. When a parent record
    > is being created, it does not make sense to forbid creation of its child records.

-   **Scope**

    Store data
