data-importer icon indicating copy to clipboard operation
data-importer copied to clipboard

[Improvement]: Missing type FieldCollection in TransformationDataTypeService

Open ngnaoh opened this issue 4 months ago • 2 comments

Improvement description

Currently, the TransformationDataTypeService in the Pimcore Data Importer does not recognize or support the FieldCollection data type. This limitation makes it difficult to build flexible and reusable transformation pipelines that involve mapping structured array data into Field Collections.

Proposed Improvement:

Add support for FieldCollection as a valid transformation data type within TransformationDataTypeService. This would allow developers to:

Use FieldCollections in custom transformers or generic ones like asDataFieldCollection

Dynamically convert array-based JSON input to properly-typed FieldCollections

Enhance compatibility with object bricks and structured nested data import workflows

Use Case Example:

{
  "data_field_collection": [
    { "data_key": "WA", "data_value": 92 },
    { "data_key": "JS", "data_value": 90 }
  ]
}

Developers should be able to configure a transformation pipeline that maps the above structure to a FieldCollection of data_field_collection elements.

Benefits:

More robust and extensible data import workflows

Improved developer experience with nested object structures

Aligns with Pimcore's flexible data modeling system

Suggested Implementation:

Add fieldcollection as a supported type in TransformationDataTypeService::FIElD_COLLECTION

Validate the handling of this type in transformation pipelines

ngnaoh avatar Jul 09 '25 05:07 ngnaoh

I like the idea, but realistically it won't make it to our roadmap anytime soon 🫤. We would review a PR though.

fashxp avatar Jul 09 '25 06:07 fashxp

Hi @fashxp. I did it my own project and importing successfully with field has type FieldCollection. I will create a PR soon.

ngnaoh avatar Jul 09 '25 06:07 ngnaoh