# Complex Logic - Relationships

**URL:** <https://community.glideapps.com/t/complex-logic-relationships/71732>\
**Category:** Ask for Help\
**Created:** [March 16, 2024, 4:53pm UTC](https://community.glideapps.com/t/complex-logic-relationships/71732 "2024-03-16T16:53:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![RhettF](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rhettf/32/69610_2.png) [@RhettF](https://community.glideapps.com/u/RhettF)\
**Post date:** [March 16, 2024, 4:53pm UTC](https://community.glideapps.com/t/complex-logic-relationships/71732/1 "2024-03-16T16:53:32Z")

</div>

Tried getting excel data to flow in glide, and perhaps I need to adjust some of my worksheets, but I’ve listed the case below, and need help establishing which relationships/queries or other columns are essential.

**High-level overview**  
5 Tables (worksheets):  
[1] Brand (Store name)  
[2] Locations  
[3] Categories  
[4] Subcategories  
[5] Items

So far:

- One [1] brand has many [2] locations and [2] locations relate to [1] brand
- One [2] location has many [3] categories and [3] categories _do not_ relate to [2] locations.
- One [3] category has many [4] subcategories and [4] subcategories relate to [3] categories
- One [4] subcategory has many [5] items and [5] items relate to [4] subcategories

Assumptions  
All [2] locations have the same [3] categories.  
All [2] Locations of the same [1] brand have the same [5] items.

**Problem**  
Eventually when I click through all the screens Brand \> Locations \> Categories \> Subcategories \> Items. I have Items showing from all brands with the correct category & subcategory. Whereas I would hope to have all the items pertaining to the selected brand & location & category & subcategory. the relationships or structure of my data is not allowing this what solutions exist so I only see the items for the correct brand/location i am in. thank you!!!

---

<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:** [March 17, 2024, 12:09am UTC](https://community.glideapps.com/t/complex-logic-relationships/71732/2 "2024-03-17T00:09:08Z")

</div>

So you will only show items on the Items screen, not anywhere else, and you want to have the context of all brand, location, category & subcategory you have navigated through to that point?

I think that will be doable if you use set column actions through the way there, or extract the relevant IDs from the screen URL.

---

<div class="post-metadata">

**Author:** ![RhettF](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rhettf/32/69610_2.png) [@RhettF](https://community.glideapps.com/u/RhettF)\
**Post date:** [March 17, 2024, 2:11am UTC](https://community.glideapps.com/t/complex-logic-relationships/71732/3 "2024-03-17T02:11:15Z")

</div>

Thank you for the suggestion - I might revisit this thread if still stuck, Best!

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [March 17, 2024, 5:19pm UTC](https://community.glideapps.com/t/complex-logic-relationships/71732/4 "2024-03-17T17:19:21Z")

</div>

> [@ThinhDinh](#):
>
> or extract the relevant IDs from the screen URL.

This is what I would do for sure. Get the screen URL using a template column. This deeplink will contain all the RowIDs of your breadcrumb path. Then, you can add filters/relations based on these values to only show the items pertaining to the screen URL

---

<div class="post-metadata">

**Author:** ![RhettF](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rhettf/32/69610_2.png) [@RhettF](https://community.glideapps.com/u/RhettF)\
**Post date:** [March 17, 2024, 6:08pm UTC](https://community.glideapps.com/t/complex-logic-relationships/71732/5 "2024-03-17T18:08:08Z")

</div>

Thread resolved! So thrilled it is working

---

<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:** [March 18, 2024, 12:00am UTC](https://community.glideapps.com/t/complex-logic-relationships/71732/6 "2024-03-18T00:00:31Z")

</div>

Great to hear!

---

<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:** [March 25, 2024, 12:01am UTC](https://community.glideapps.com/t/complex-logic-relationships/71732/7 "2024-03-25T00:01:15Z")

</div>

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