# Vorauswahl - Datenbankfeld?

**URL:** https://forum.shopware.com/t/vorauswahl-datenbankfeld/39419
**Category:** Programmierung
**Created:** [30. August 2016 um 07:52 UTC](https://forum.shopware.com/t/vorauswahl-datenbankfeld/39419 "2016-08-30T07:52:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MichaM](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@MichaM](https://forum.shopware.com/u/MichaM)
#### Post date: [30. August 2016 um 07:52 UTC](https://forum.shopware.com/t/vorauswahl-datenbankfeld/39419/1 "2016-08-30T07:52:32Z")

</div>

Hallo,

ich suche verzweifelt das (die) Feld(er), die ich bearbeiten muss, damit ich unter Artikel -\> Varianten -\> verfügbare Varianten das Feld „Vorauswahl“ ändern kann. (Zweck der Übung ist, eine andere Variante als Vorauswahl anzuzeigen, möglichst über die API)

Vielen Dank für eure Mühe.

Micha

---

<div class="post-metadata">

### Author: ![Oliver\_Skroblin](https://avatars.discourse-cdn.com/v4/letter/o/6bbea6/32.png) [@Oliver\_Skroblin](https://forum.shopware.com/u/Oliver_Skroblin)
#### Post date: [1. September 2016 um 08:15 UTC](https://forum.shopware.com/t/vorauswahl-datenbankfeld/39419/2 "2016-09-01T08:15:31Z")

</div>

Hi,

in der API sendest du ja ein array mit varianten mit. Hier kannst du bei einer Variante sagen “isMain =\> true” wordurch diese als Hauptvariante gewählt wird

Mini Beispiel.

```
API: /articles/1/
$articleData = [
  'id' => 1,
  'name' => 'test',
  'variants' => [
     ['id' => 10, 'number' => 'ABC', 'isMain' => true],
     ['id' => 11, 'number' => 'ABC.1', 'isMain' => false],
     //...
  ]
];

```

&nbsp;

---

<div class="post-metadata">

### Author: ![MichaM](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@MichaM](https://forum.shopware.com/u/MichaM)
#### Post date: [1. September 2016 um 14:09 UTC](https://forum.shopware.com/t/vorauswahl-datenbankfeld/39419/3 "2016-09-01T14:09:21Z")

</div>

Hallo Oliver,

&nbsp;

danke, das war´s 🙂
