# Standardwert für eigene Attribute

**URL:** <https://forum.shopware.com/t/standardwert-fur-eigene-attribute/43871>\
**Category:** International (English Only)\
**Tags:** programming\
**Created:** [20. Februar 2017 um 15:17 UTC](https://forum.shopware.com/t/standardwert-fur-eigene-attribute/43871 "2017-02-20T15:17:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![schockemoehle](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@schockemoehle](https://forum.shopware.com/u/schockemoehle)\
**Post date:** [20. Februar 2017 um 15:17 UTC](https://forum.shopware.com/t/standardwert-fur-eigene-attribute/43871/1 "2017-02-20T15:17:11Z")

</div>

Moin,

ich suche aktuell nach einer Möglichkeit wie man einem eigenen Attribut (bspw. s\_user\_attributes -\> xyz) einen Standardwert mitgeben kann. Hat jmd eine Idee wie man das mit dem neuen Attributsystem machen kann?

MfG

---

<div class="post-metadata">

**Author:** ![Thomas](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/thomas/32/8167_2.png) [@Thomas](https://forum.shopware.com/u/Thomas)\
**Post date:** [21. Februar 2017 um 08:47 UTC](https://forum.shopware.com/t/standardwert-fur-eigene-attribute/43871/2 "2017-02-21T08:47:46Z")

</div>

```
$service = $this->container->get('shopware_attribute.crud_service');
$service->update(
    's_articles_attributes',
    'foo_bar',
    'string',
    [
        'label' => 'foo',
        'supportText' => 'foo',
        'helpText' => 'DUMMfoo',
        'displayInBackend' => true,
        'position' => 100,
        'custom' => true,
     ],
     null,
     false,
     'default foo'
);

```

So in etwa müsste das gehen 🙂

---

<div class="post-metadata">

**Author:** ![schockemoehle](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@schockemoehle](https://forum.shopware.com/u/schockemoehle)\
**Post date:** [21. Februar 2017 um 08:57 UTC](https://forum.shopware.com/t/standardwert-fur-eigene-attribute/43871/3 "2017-02-21T08:57:24Z")

</div>

Danke, das hat super funktioniert!&nbsp;
