# Custom Fields are not showing in administration

**URL:** <https://forum.shopware.com/t/custom-fields-are-not-showing-in-administration/93690>\
**Category:** Shopware 6 (English)\
**Tags:** programming\
**Created:** [28. März 2022 um 11:52 UTC](https://forum.shopware.com/t/custom-fields-are-not-showing-in-administration/93690 "2022-03-28T11:52:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hasan.h](https://avatars.discourse-cdn.com/v4/letter/h/e56c9b/32.png) [@hasan.h](https://forum.shopware.com/u/hasan.h)\
**Post date:** [28. März 2022 um 11:52 UTC](https://forum.shopware.com/t/custom-fields-are-not-showing-in-administration/93690/1 "2022-03-28T11:52:30Z")

</div>

Hello,  
I want to create custom fields via code that are editable in the admin backend. I have created 2 custom field sets using the „Adding an actual custom field“ part of the following tutorial.

> **[Add custom field](https://developer.shopware.com/docs/guides/plugins/plugins/framework/custom-field/add-custom-field)**

But my custom fields are still not showing up in the administration.  
This is the directory I have worked with:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/3X/e/9/e90bd99e9ad1675995f3a20c7f27ca931c498ccd.png)  
And this is the code I have written:

\<?php declare(strict\_types=1); namespace CrystalComp\Service; use Shopware\Core\Defaults; use Shopware\Core\Framework\Context; use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria; use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter; use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface; use Shopware\Core\System\CustomField\CustomFieldTypes; class WritingData { // private EntityRepositoryInterface $productRepository; // private EntityRepositoryInterface $topicRepository; private EntityRepositoryInterface $customFieldSetRepository; public function \_\_construct(EntityRepositoryInterface $customFieldSetRepository) { // $this-\>productRepository = $productRepository; // $this-\>topicRepository = $topicRepository; $this-\>customFieldSetRepository = $customFieldSetRepository; } public function writeData(Context $context): void { $this-\>customFieldSetRepository-\>create([[ 'name' =\> 'videos', 'config' =\> [ 'label' =\> [ 'en-GB' =\> 'English custom field set label', 'de-DE' =\> 'German custom field set label'] ], 'relations' =\> [[ 'id' =\> Uuid::randomHex(), 'entityName' =\> 'product'] ], 'customFields' =\> [[ 'name' =\> 'video-1', 'type' =\> CustomFieldTypes::media, 'config' =\> [ 'label' =\> [ 'en-GB' =\> 'Custom field for media', 'de-DE' =\> 'Custom field de media'], 'customFieldPosition' =\> 1 ] ], ['name' =\> 'video-2', 'type' =\> CustomFieldTypes::media, 'config' =\> [ 'label' =\> [ 'en-GB' =\> 'Custom field for media', 'de-DE' =\> 'Custom field de media'], 'customFieldPosition' =\> 2 ] ], ['name' =\> 'video-3', 'type' =\> CustomFieldTypes::media, 'config' =\> [ 'label' =\> [ 'en-GB' =\> 'Custom field for media', 'de-DE' =\> 'Custom field de media'], 'customFieldPosition' =\> 3 ] ], ['name' =\> 'video-4', 'type' =\> CustomFieldTypes::media, 'config' =\> [ 'label' =\> [ 'en-GB' =\> 'Custom field for media', 'de-DE' =\> 'Custom field de media'], 'customFieldPosition' =\> 4 ] ], ['name' =\> 'video-5', 'type' =\> CustomFieldTypes::media, 'config' =\> [ 'label' =\> [ 'en-GB' =\> 'Custom field for media', 'de-DE' =\> 'Custom field de media'], 'customFieldPosition' =\> 5 ] ], ['name' =\> 'video-6', 'type' =\> CustomFieldTypes::media, 'config' =\> [ 'label' =\> [ 'en-GB' =\> 'Custom field for media', 'de-DE' =\> 'Custom field de media'], 'customFieldPosition' =\> 6 ] ] ] ] ], $context); $this-\>customFieldSetRepository-\>create([[ 'name' =\> 'topics', 'config' =\> [ 'label' =\> [ 'en-GB' =\> 'English custom field set label', 'de-DE' =\> 'German custom field set label'] ], 'relations' =\> [[ 'id' =\> Uuid::randomHex(), 'entityName' =\> 'product'] ], 'customFields' =\> [[ 'name' =\> 'topic-1', 'type' =\> CustomFieldTypes::text, 'config' =\> [ 'label' =\> [ 'en-GB' =\> 'Custom field for text', 'de-DE' =\> 'Custom field de text'], 'customFieldPosition' =\> 1 ] ], ['name' =\> 'topic-2', 'type' =\> CustomFieldTypes::text, 'config' =\> [ 'label' =\> [ 'en-GB' =\> 'Custom field for text', 'de-DE' =\> 'Custom field de text'], 'customFieldPosition' =\> 2 ] ], ['name' =\> 'topic-3', 'type' =\> CustomFieldTypes::text, 'config' =\> [ 'label' =\> [ 'en-GB' =\> 'Custom field for text', 'de-DE' =\> 'Custom field de text'], 'customFieldPosition' =\> 3 ] ], ['name' =\> 'topic-4', 'type' =\> CustomFieldTypes::text, 'config' =\> [ 'label' =\> [ 'en-GB' =\> 'Custom field for text', 'de-DE' =\> 'Custom field de text'], 'customFieldPosition' =\> 4 ] ], ['name' =\> 'topic-5', 'type' =\> CustomFieldTypes::text, 'config' =\> [ 'label' =\> [ 'en-GB' =\> 'Custom field for text', 'de-DE' =\> 'Custom field de text'], 'customFieldPosition' =\> 5 ] ] ] ] ], $context); } }
