# New column for product entity

**URL:** <https://forum.shopware.com/t/new-column-for-product-entity/66220>\
**Category:** General Questions (EN)\
**Created:** [13. April 2020 um 13:39 UTC](https://forum.shopware.com/t/new-column-for-product-entity/66220 "2020-04-13T13:39:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![a\_buzdugan](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@a\_buzdugan](https://forum.shopware.com/u/a_buzdugan)\
**Post date:** [13. April 2020 um 13:39 UTC](https://forum.shopware.com/t/new-column-for-product-entity/66220/1 "2020-04-13T13:39:11Z")

</div>

Hello,

Based on bundle plugin for sw6 I want to create a different logic and not using custom fields.

Steps:

1. Create a new column in product table

2. use EntityExtensionInterface to a add a new Json Field

3. Create a subscriber on product loaded and load data into product.extensions.newColumn

4. Create in admin product edit a sw-entity-multi-select where I want for one product to assign more products in a json

5. Load list of available product for selection, pre-populate assigned products, save select on each change

Most of the work is complete but I stopped when wanting to save the new column value via the admin api call.

For example:

POST

[http://domani.com/api/v1/product/05e1008fc06343578492a76d2196a7c9/extensions/newColumn](http://domani.com/api/v1/product/05e1008fc06343578492a76d2196a7c9/extensions/newColumn)

Body:

{  
&nbsp;&nbsp; &nbsp;“yyy”: “xxxx”  
}

Returns:

{

“errors”: [

{

“code”: “0”,

“status”: “500”,

“title”: “Internal Server Error”,

“detail”: “Attempted to call an undefined method named “getReferenceDefinition” of class “Shopware\Core\Framework\DataAbstractionLayer\Field\StringField”.”

}

]

}

- 

This neither is possible:

[http://domani.com/api/v1/product/05e1008fc06343578492a76d2196a7c9](http://domani.com/api/v1/product/05e1008fc06343578492a76d2196a7c9)

PATCH

{

“newColumn”: {“xxx”:“yyy”}

}

- 

&nbsp;

Please advise if the above is possible .

&nbsp;

We wanted to display the field separately from custom fields sets for an easier navigation/usage.

We can switch to many to many select with a new table for our parent / child products if not possible as we wanted into a simple json field.

&nbsp;

Thank you,

AndreiB.
