---
title: "Data Processing"
manual: "Content Blocks"
version: "main"
permalink: "https://docs.typo3.org/permalink/friendsoftypo3/content-blocks:data-processing-event@main"
source: "DeveloperCorner/DataProcessing/Index.rst"
rendered: "2026-09-22T14:15:39+00:00"
---

# Data Processing {#data-processing-event}

Content Blocks is based on the new [Record API](https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.2/Feature-103783-RecordTransformationDataProcessor.html#feature-103783-1715113274)
in TYPO3 v13. As soon as a `Record` is created
and enriched, it is immutable. This means the standard way of data processing
via custom [DataProcessors](https://docs.typo3.org/m/typo3/reference-coreapi/14.3/en-us/ApiOverview/ContentElements/CustomDataProcessing.html#content-elements-custom-data-processor)
will not work anymore, if it was based on manipulating the
`$processedData['data']` array.

> [!NOTE]
> It is still possible to create a new variable alongside `data`.

The new recommended way adding custom logic via PHP is to use the new PSR-14
[RecordCreationEvent](https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.3/Feature-104846-CustomFieldTransformationsForNewRecords.html#feature-104846-1725631434). This event has
the advantage that it is always triggered as soon as a Record is created,
independent of frontend or backend context or even in scenarios where the Record
is part of a nested structure.

## Example {#example}

The event listener class, using the PHP attribute `#[AsEventListener]` for
registration, creates a `Coordinates` object based on the field value of
the `coordinates` field for the custom `maps` content type.

```php
final class RecordCreationEventListener
{
    #[AsEventListener]
    public function __invoke(\TYPO3\CMS\Core\Domain\Event\RecordCreationEvent $event): void
    {
        $rawRecord = $event->getRawRecord();

        if ($rawRecord->getMainType() === 'tt_content' && $rawRecord->getRecordType() === 'maps' && $event->hasProperty('coordinates')) {
            $event->setProperty(
                'coordinates',
                new Coordinates($event->getProperty('coordinates'))
            );
        }
    }
}
```

A more extensive example can be found in the [examples extension](https://github.com/friendsoftypo3/content-blocks/tree/main/Build/content_blocks_examples/Classes/EventListener/RecordCreationEventListener.php).
