Answers.Body: <p>About this Table-approach: for the table columns you can define the data type of a column. If you would want an Entry ID, you would probably pick 'number' or 'text' but how about using 'Entry' as a column type?</p>
  <p>I am not 100% sure that it is supported by the built-in Table field but Super Table definitely has it.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-10-02T20:15:59.797Z
Answers.LastActivityDate: 2024-10-02T20:15:59.797Z
Answers.UserDisplayName: Niek
Body: <p>Let's say I have two <code>Entry</code> channels: <strong>Items</strong> and <strong>Collections</strong>. Collections have a <code>relatedItems</code> field in them. Items aren't unique to a Collection, and based on the Collection they're in, they could have a different <strong>quantity</strong> than the same item in a different collection.</p>
  <p>I know I could create a matrix field called <code>relatedItems</code>, where each block has a field to choose the Item <code>Entry</code> and a number field to enter the quantity. My issue with this is there'll be thousands of Items and Collections, so there'll be multiple single-use <code>Entry</code> matrix blocks for the same Item spread out over many Collections. It feels <em>incorrect</em>, like I'll be generating unnecessary bloat in my database.</p>
  <p>Another idea I thought of is to use a Table field in Collection entries. One column would be the related Item's <code>Entry</code> ID, and the other column would be the Item's quantity for that Collection. Now, there's only one <code>Entry</code> per Item (in the &quot;Items&quot; channel), whose ID can be referenced in multiple places along with a quantity. My only issue with this is that, when I view a Collection entry, I'll just see a bunch of IDs listed in a table. I can't easily jump to the Item entry to edit something like I could if it was a matrix block with a relation field.</p>
  <p>Is there something I'm overlooking in Craft 5 to solve this? Since a channel has <code>Entry</code> elements and matrix fields (as of Craft 5) uses <code>Entry</code> elements too for their blocks, I don't want to create multiple entries/blocks for one Item. It seems redundant and excessive. Any advanced techniques I'm not thinking of?</p>
  <p>PS, this isn't an e-commerce site. I'm trying to simplify the names of the channels for the sake of this post.</p>
  
Tags: <entries><matrix><craft5>
Title: How to reuse entries but change data in one field | Craft 5
ThreadText: # How to reuse entries but change data in one field | Craft 5
  
  (Asked by: username_0 on 2024-10-01)
  
  Let's say I have two `Entry` channels: **Items** and **Collections**. Collections have a `relatedItems` field in them. Items aren't unique to a Collection, and based on the Collection they're in, they could have a different **quantity** than the same item in a different collection.
  
  I know I could create a matrix field called `relatedItems`, where each block has a field to choose the Item `Entry` and a number field to enter the quantity. My issue with this is there'll be thousands of Items and Collections, so there'll be multiple single-use `Entry` matrix blocks for the same Item spread out over many Collections. It feels *incorrect*, like I'll be generating unnecessary bloat in my database.
  
  Another idea I thought of is to use a Table field in Collection entries. One column would be the related Item's `Entry` ID, and the other column would be the Item's quantity for that Collection. Now, there's only one `Entry` per Item (in the "Items" channel), whose ID can be referenced in multiple places along with a quantity. My only issue with this is that, when I view a Collection entry, I'll just see a bunch of IDs listed in a table. I can't easily jump to the Item entry to edit something like I could if it was a matrix block with a relation field.
  
  Is there something I'm overlooking in Craft 5 to solve this? Since a channel has `Entry` elements and matrix fields (as of Craft 5) uses `Entry` elements too for their blocks, I don't want to create multiple entries/blocks for one Item. It seems redundant and excessive. Any advanced techniques I'm not thinking of?
  
  PS, this isn't an e-commerce site. I'm trying to simplify the names of the channels for the sake of this post.
  
  **Tags:** entries, matrix, craft5
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-10-02. Score: 0
  
  About this Table-approach: for the table columns you can define the data type of a column. If you would want an Entry ID, you would probably pick 'number' or 'text' but how about using 'Entry' as a column type?
  
  I am not 100% sure that it is supported by the built-in Table field but Super Table definitely has it.
  
  
  ---
  
  