<p>From a database point of view you would have a pivot table between stores and products. And in that pivot table you would have additional columns like the price. </p>

<h1>Using native fields</h1>

<p>You can‘t do that on a relation field per se. (In this case entry field, assuming that products are entries) But you could wrap a repeatable field around an entry field and a price field, e.g. matrix or table and build the relationship this way. This way you can select products from within a store entry and put a price on each product. </p>

<p>One caveat is that you can’t bulk select products anymore. You’d have to select them one by one.</p>

<h1>Alternative solution</h1>

<p>You could write a custom module where you create a new field type that solves your problem. This would not result in an actual pivot table but it would work in a similar way. As far as I know a field type's value is bound to be saved in a single database column (may be wrong). However, you could even come up with some kind of bulk editing solution if you want to, although this would require some more work.</p>

CC BY-SA 4.0
2020-06-08T10:58:53.217Z
Thanks for you answer ! For the matrix solution, do you think it's as reliable than just creating two models + a pivot table in yee ?
Antoine
CC BY-SA 4.0
2020-06-08T11:19:56.647Z
It depends on what reliable is for you :) I updated the answer with an alternative solution.
Johannes
CC BY-SA 4.0
2020-06-05T18:09:03.030Z
2020-06-08T11:19:47.867Z
2020-06-08T11:19:47.867Z
Johannes
<p>I'm searching for a way to have additional fields on relations.
The simplest exemple would be; you have stores entries and products entries, and you want to create a many to many relationship with the price as additional information.</p>

<p>How could it be done ?</p>

<p>Thanks in advance,</p>

<relations>
Entries relations with additional fields
# Entries relations with additional fields

(Asked by: username_0 on 2020-06-05)

I'm searching for a way to have additional fields on relations.
The simplest exemple would be; you have stores entries and products entries, and you want to create a many to many relationship with the price as additional information.

How could it be done ?

Thanks in advance,

**Tags:** relations


---

## 1 answers

### Answer by username_1 on 2020-06-05. Score: 2

From a database point of view you would have a pivot table between stores and products. And in that pivot table you would have additional columns like the price.

# Using native fields

You can‘t do that on a relation field per se. (In this case entry field, assuming that products are entries) But you could wrap a repeatable field around an entry field and a price field, e.g. matrix or table and build the relationship this way. This way you can select products from within a store entry and put a price on each product.

One caveat is that you can’t bulk select products anymore. You’d have to select them one by one.

# Alternative solution

You could write a custom module where you create a new field type that solves your problem. This would not result in an actual pivot table but it would work in a similar way. As far as I know a field type's value is bound to be saved in a single database column (may be wrong). However, you could even come up with some kind of bulk editing solution if you want to, although this would require some more work.

> **Comments:**
> **username_0**: Thanks for you answer ! For the matrix solution, do you think it's as reliable than just creating two models + a pivot table in yee ?  
> **username_1**: It depends on what reliable is for you :) I updated the answer with an alternative solution.  

---

