# Consolidating values in an inline list

**URL:** <https://community.glideapps.com/t/consolidating-values-in-an-inline-list/56810>\
**Category:** Ask for Help\
**Created:** [January 17, 2023, 8:33pm UTC](https://community.glideapps.com/t/consolidating-values-in-an-inline-list/56810 "2023-01-17T20:33:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ellerybubble](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ellerybubble/32/52976_2.png) [@ellerybubble](https://community.glideapps.com/u/ellerybubble)\
**Post date:** [January 17, 2023, 8:33pm UTC](https://community.glideapps.com/t/consolidating-values-in-an-inline-list/56810/1 "2023-01-17T20:33:53Z")

</div>

I’m creating a meal planning app that contains a shopping list for users, based on meals that have been assigned to them. The way I’ve set it up is by creating a Meal Plan screen which contains an inline list of recipes and a list relation of ingredients (related to the selected recipes).

Within the details screen of the list relation, I’d like to consolidate ingredients and quantities instead of having them appear multiple times (because they’re in multiple rows).

For example if two recipes within the meal plan each contain 2 slices of wholemeal bread, how do I consolidate it to show 4 slices of wholemeal bread instead?

Example below:

 ![Screen Shot 2023-01-18 at 7.32.27 am](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/6/465a6af3a7d41d77324c2929134df4ea056edcc6.png)

Also - is there a way to remove the \> arrow at the end of each item in the detail screen of the inline list? I’ve disabled the action for a Detail screen to open but the arrow still stays there.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [January 18, 2023, 12:07am UTC](https://community.glideapps.com/t/consolidating-values-in-an-inline-list/56810/2 "2023-01-18T00:07:25Z")

</div>

> [@ellerybubble](#):
>
> For example if two recipes within the meal plan each contain 2 slices of wholemeal bread, how do I consolidate it to show 4 slices of wholemeal bread instead?

I don’t know exactly how you structure the data, so I’m assuming it looks something like this:

| Meal Plan ID | Type | Name | Quantity |
| --- | --- | --- | --- |
| MP001 | Bakery | Wholemeal Bread | 2 |
| MP001 | Bakery | Wholemeal Bread | 2 |
| MP001 | Bakery | Multigrain Bagel | 1 |

Then, what I would do is:

- Add a rowID column so it becomes something like this:

| rowID | Meal Plan ID | Food Type | Food Name | Quantity |
| --- | --- | --- | --- | --- |
| abc | MP001 | Bakery | Wholemeal Bread | 2 |
| def | MP001 | Bakery | Wholemeal Bread | 2 |
| ghi | MP001 | Bakery | Multigrain Bagel | 1 |

- Create a template column joining the meal plan ID, food type & food name, let’s call it food\_temp:

| rowID | Meal Plan ID | Food Type | Food Name | Quantity | Food\_Temp |
| --- | --- | --- | --- | --- | --- |
| abc | MP001 | Bakery | Wholemeal Bread | 2 | MP001-Bakery-Wholemeal Bread |
| def | MP001 | Bakery | Wholemeal Bread | 2 | MP001-Bakery-Wholemeal Bread |
| ghi | MP001 | Bakery | Multigrain Bagel | 1 | MP001-Bakery-Multigrain Bagel |

- Create a multiple relation from the food\_temp column to itself.

- Add a “first ID” column to return the first rowID from the relation.

| rowID | Meal Plan ID | Food Type | Food Name | Quantity | Food\_Temp | firstID |
| --- | --- | --- | --- | --- | --- | --- |
| abc | MP001 | Bakery | Wholemeal Bread | 2 | MP001-Bakery-Wholemeal Bread | abc |
| def | MP001 | Bakery | Wholemeal Bread | 2 | MP001-Bakery-Wholemeal Bread | abc |
| ghi | MP001 | Bakery | Multigrain Bagel | 1 | MP001-Bakery-Multigrain Bagel | ghi |

- Add a rollup column to sum the quantities on top of each relation.

| rowID | Meal Plan ID | Food Type | Food Name | Quantity | Food\_Temp | firstID | Sum |
| --- | --- | --- | --- | --- | --- | --- | --- |
| abc | MP001 | Bakery | Wholemeal Bread | 2 | MP001-Bakery-Wholemeal Bread | abc | 4 |
| def | MP001 | Bakery | Wholemeal Bread | 2 | MP001-Bakery-Wholemeal Bread | abc | 4 |
| ghi | MP001 | Bakery | Multigrain Bagel | 1 | MP001-Bakery-Multigrain Bagel | ghi | 1 |

Then in your inline list, filter what to show by: firstID is rowID

Show the “sum” amount alongside the unit. You might want to consider singular and plural units for each type of food.

---

<div class="post-metadata">

**Author:** ![ellerybubble](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ellerybubble/32/52976_2.png) [@ellerybubble](https://community.glideapps.com/u/ellerybubble)\
**Post date:** [January 18, 2023, 7:35pm UTC](https://community.glideapps.com/t/consolidating-values-in-an-inline-list/56810/3 "2023-01-18T19:35:26Z")

</div>

Hi ThinhDinh, thanks so much for your help! I’ve gone into Glide to try and follow your instructions but I can’t get this approach to work because I’ve set the data up a little differently.

Instead of each row containing a single meal plan, I have a multiple relation column to the meal plans and then a lookup for meal plan IDs - so there are multiple meal plan IDs that the Ingredient connects to.

Any advice on how to approach with this data structure?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [January 19, 2023, 1:43am UTC](https://community.glideapps.com/t/consolidating-values-in-an-inline-list/56810/4 "2023-01-19T01:43:29Z")

</div>

Can you give me a screenshot of how you’re setting it up

---

<div class="post-metadata">

**Author:** ![ellerybubble](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ellerybubble/32/52976_2.png) [@ellerybubble](https://community.glideapps.com/u/ellerybubble)\
**Post date:** [February 12, 2023, 4:41am UTC](https://community.glideapps.com/t/consolidating-values-in-an-inline-list/56810/5 "2023-02-12T04:41:22Z")

</div>

Hi ThinhDinh, I’ve come back to look at this and I have set the data up per the instructions above. You mention _Add a “first ID” column to return the first rowID from the relation_. Can you please tell me how to do this? Everything else I believe I have in hand. Thank you again!

---

<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:** [February 12, 2023, 6:03am UTC](https://community.glideapps.com/t/consolidating-values-in-an-inline-list/56810/6 "2023-02-12T06:03:22Z")

</div>

That would be a Single Value column.  
Point it at the relation and select the first RowID.

---

<div class="post-metadata">

**Author:** ![ellerybubble](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ellerybubble/32/52976_2.png) [@ellerybubble](https://community.glideapps.com/u/ellerybubble)\
**Post date:** [February 12, 2023, 6:20am UTC](https://community.glideapps.com/t/consolidating-values-in-an-inline-list/56810/7 "2023-02-12T06:20:43Z")

</div>

Thanks so much Darren\_Murphy and ThinhDinh! I’ve been able to achieve what I was looking for thanks to your help 🙂

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [February 13, 2023, 6:20am UTC](https://community.glideapps.com/t/consolidating-values-in-an-inline-list/56810/8 "2023-02-13T06:20:58Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
