# Bill of Materials : auto select related components from a main selection

**URL:** <https://community.glideapps.com/t/bill-of-materials-auto-select-related-components-from-a-main-selection/69895>\
**Category:** Ask for Help\
**Created:** [January 23, 2024, 12:42pm UTC](https://community.glideapps.com/t/bill-of-materials-auto-select-related-components-from-a-main-selection/69895 "2024-01-23T12:42:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mozzie](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mozzie/32/17519_2.png) [@Mozzie](https://community.glideapps.com/u/Mozzie)\
**Post date:** [January 23, 2024, 12:42pm UTC](https://community.glideapps.com/t/bill-of-materials-auto-select-related-components-from-a-main-selection/69895/1 "2024-01-23T12:42:48Z")

</div>

Hi

I’ve built a proposal / quotation app. Some items are made up of components. For example: Stitchliner - 1 x AFC-50, 1 x SPF-50 and 1 x HTS-50. What I would like to do is to select the Model Stitchliner and automatically add the related components. Another example would be an accessory which is made up of 3 components : 1 x item 1 and 2 x item 2.

Adding singular items is straight forward but I’m stuck on selecting the Main model and auto adding it’s components.

I’ve done this in excel which is pretty straight forward as it’s a simple cell formula but I’m stuck in Glide. Has anybody done this before? If so, could you provide some guidance?  
cheers

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [January 23, 2024, 12:55pm UTC](https://community.glideapps.com/t/bill-of-materials-auto-select-related-components-from-a-main-selection/69895/2 "2024-01-23T12:55:17Z")

</div>

I assume the question is in the context of a form, where a new row is being created?  
Given that, how should the sub-components be added? ie. should they be added each on a separate/new row, or together as a single value with the parent item?

---

<div class="post-metadata">

**Author:** ![Mozzie](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mozzie/32/17519_2.png) [@Mozzie](https://community.glideapps.com/u/Mozzie)\
**Post date:** [January 23, 2024, 1:05pm UTC](https://community.glideapps.com/t/bill-of-materials-auto-select-related-components-from-a-main-selection/69895/3 "2024-01-23T13:05:26Z")

</div>

Thanks for your reply. Seperate/New rows. Yellow box is the selection. See excel screenshot:

Screenshot 1 is the selection

 ![Screenshot 2024-01-23 at 10.59.49 pm](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/d/cde49df70b54c6fb334f1cf535a69f718e5adf89.png)  
Screenshot 2 is the proposal contract result  
 ![Screenshot 2024-01-23 at 11.00.32 pm](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/3/7307a254d63c94ecbabbdc8e45bfc1c17893feb8.png)  
cheers

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [January 23, 2024, 1:30pm UTC](https://community.glideapps.com/t/bill-of-materials-auto-select-related-components-from-a-main-selection/69895/4 "2024-01-23T13:30:16Z")

</div>

Okay, this is not a simple thing to do in Glide. To add related rows automatically when a parent row is created requires all sorts of gymnastics using a helper table and the Glide API. And it’s not something I can explain in a few sentences.

Given that the end result is a sales proposal, I wonder if it might be better/easier to generate the line items at the same time the proposal is generated?

How is that done - are you using one of the PDF integrations?

---

<div class="post-metadata">

**Author:** ![Mozzie](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mozzie/32/17519_2.png) [@Mozzie](https://community.glideapps.com/u/Mozzie)\
**Post date:** [January 23, 2024, 2:12pm UTC](https://community.glideapps.com/t/bill-of-materials-auto-select-related-components-from-a-main-selection/69895/5 "2024-01-23T14:12:37Z")

</div>

Process is

1. Click New proposal and fill out a form: Proposal number, Company name and details.
2. Create proposal
3. Add products.
4. Create PDF: At this stage it’s DocsAutomator.

Once the proposal is complete and accepted I’ll submit to turn it into a contract and generate a contract PDF to sign.  
The reason for automatically adding components is some machines have a number of compulsory components which need to be ordered separately. The purpose was to have it listed on the documents so nobody had to think about what was needed. Anybody creating a contract could do so without thinking. It’s what I’ve done on the excel spreadsheet for different machines.

cheers

 ![Screenshot 2024-01-24 at 12.03.14 am](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/1/01410ed7a28e76cc00b6edb5155ba90afc4c18ed.jpeg)  
 ![Screenshot 2024-01-24 at 12.02.11 am](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/a/ba692b127b6acdb53e63acf2e7df62c22949c095.jpeg)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [January 23, 2024, 2:19pm UTC](https://community.glideapps.com/t/bill-of-materials-auto-select-related-components-from-a-main-selection/69895/6 "2024-01-23T14:19:55Z")

</div>

Okay, I see.

Just looking at your second screen shot, I see the following:

 ![CleanShot 2024-01-23 at 22.15.49@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/a/ea2aa23728928f3578e24e637b65eac0c826d0e3.png)

Is that list of sub-components part of the product description, or is it automatically generated (eg. joined list through a relation)?

Either way, I’m wondering if it would be a lot simpler to simply attach a list of sub-components in a single column with the parent item?

If you use a new line separator instead of the default comma, you could have them listed one under the other. Would something like that work?

---

<div class="post-metadata">

**Author:** ![Mozzie](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mozzie/32/17519_2.png) [@Mozzie](https://community.glideapps.com/u/Mozzie)\
**Post date:** [January 24, 2024, 12:16am UTC](https://community.glideapps.com/t/bill-of-materials-auto-select-related-components-from-a-main-selection/69895/7 "2024-01-24T00:16:32Z")

</div>

Hi

Not sure what you mean? I currently have the parent and then an array column for the components.This then allows me to relate them back to the parent and show a list:

Parent Item

 ![Screenshot 2024-01-24 at 10.01.22 am](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/3/9347565e3e257b3b97578658904b51261e49d012.jpeg)  
Detail screen of components:  
 ![Screenshot 2024-01-24 at 8.01.58 am](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/c/5c2222058d14aace9645eeeed97ca1efc8f4b7ac.jpeg)  
Standard items = What the machine comes with. Machine options etc are the additional add ons.

What would be best is an inline list as a checklist where I could tick each component required and put a qty in the field and then submit.

cheers
