# Lookup a relationship column based on a criteria

**URL:** <https://community.glideapps.com/t/lookup-a-relationship-column-based-on-a-criteria/34401>\
**Category:** Ask for Help\
**Created:** [November 11, 2021, 4:29pm UTC](https://community.glideapps.com/t/lookup-a-relationship-column-based-on-a-criteria/34401 "2021-11-11T16:29:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Food2Soil](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/food2soil/32/659_2.png) [@Food2Soil](https://community.glideapps.com/u/Food2Soil)\
**Post date:** [November 11, 2021, 4:29pm UTC](https://community.glideapps.com/t/lookup-a-relationship-column-based-on-a-criteria/34401/1 "2021-11-11T16:29:57Z")

</div>

I am trying to use tags (in card layout) to create dynamic user specific alerts. I have several stores and the user is the store manager. The opening screen is the dashboard (card layout) where each card takes the user to a different screen. One of the cards is linked to an order screen. I want to use the tag component in the card to show them a certain symbol if they have an open order.

Here’s what I’ve done so far.  
-Set up a template column in the Dashboard to capture the user’s (store manager’s) email address  
-Set up relation column in the Dashboard that matches the user’s email address to the Order form. This relation picks up all orders (filled and open) for that store manager.  
Now what I need to do is to somehow lookup only the open orders that are being retrieved through the relation setup. and then use IF-Then-Else to populate a column which will inform the tag field.  
How do I do this? Am I on the right track?  
Thanks so much!

---

<div class="post-metadata">

**Author:** ![Lin\_Altshuler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lin_altshuler/32/32591_2.png) [@Lin\_Altshuler](https://community.glideapps.com/u/Lin_Altshuler)\
**Post date:** [November 11, 2021, 4:49pm UTC](https://community.glideapps.com/t/lookup-a-relationship-column-based-on-a-criteria/34401/2 "2021-11-11T16:49:56Z")

</div>

I would create an If then else column in the orders table and set to show the managers email If status is open, else blank for all other orders.  
Then create the relation from the Dashboard using the manger email to the if then else column.  
Hope it helps…

---

<div class="post-metadata">

**Author:** ![Food2Soil](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/food2soil/32/659_2.png) [@Food2Soil](https://community.glideapps.com/u/Food2Soil)\
**Post date:** [November 11, 2021, 8:29pm UTC](https://community.glideapps.com/t/lookup-a-relationship-column-based-on-a-criteria/34401/3 "2021-11-11T20:29:41Z")

</div>

Thankyou @Lin_Altshuler. That worked and was easy enough!  
I have another problem though which I didn’t realize earlier. For the cards layout i can only specify one column for the tag field. I have multiple tag columns in the dashboard because like the order form there are other forms that also have dynamic alerts. Do you have a solution for this? Maybe I need to setup the spreadsheet differently?

---

<div class="post-metadata">

**Author:** ![Lin\_Altshuler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lin_altshuler/32/32591_2.png) [@Lin\_Altshuler](https://community.glideapps.com/u/Lin_Altshuler)\
**Post date:** [November 11, 2021, 8:45pm UTC](https://community.glideapps.com/t/lookup-a-relationship-column-based-on-a-criteria/34401/4 "2021-11-11T20:45:34Z")

</div>

how many tags at most do you have?

---

<div class="post-metadata">

**Author:** ![Lin\_Altshuler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lin_altshuler/32/32591_2.png) [@Lin\_Altshuler](https://community.glideapps.com/u/Lin_Altshuler)\
**Post date:** [November 11, 2021, 9:08pm UTC](https://community.glideapps.com/t/lookup-a-relationship-column-based-on-a-criteria/34401/5 "2021-11-11T21:08:53Z")

</div>

In any case It can only be done using CSS If you want the tags separated on the card.  
If you just want the data to show you can use a template column and some Icons to make it prettier.

---

<div class="post-metadata">

**Author:** ![Food2Soil](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/food2soil/32/659_2.png) [@Food2Soil](https://community.glideapps.com/u/Food2Soil)\
**Post date:** [November 11, 2021, 9:29pm UTC](https://community.glideapps.com/t/lookup-a-relationship-column-based-on-a-criteria/34401/6 "2021-11-11T21:29:25Z")

</div>

2 at a minimum. I’m fine using icons. Would that also need to be done via CSS? can you walk me thru the steps if this can be done thru a non-css route? thank you so much

---

<div class="post-metadata">

**Author:** ![Lin\_Altshuler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lin_altshuler/32/32591_2.png) [@Lin\_Altshuler](https://community.glideapps.com/u/Lin_Altshuler)\
**Post date:** [November 11, 2021, 9:37pm UTC](https://community.glideapps.com/t/lookup-a-relationship-column-based-on-a-criteria/34401/7 "2021-11-11T21:37:02Z")

</div>

I would create an If then else column in the orders table and set to show the managers email If status is open, else blank for all other orders.  
Then create the relation from the Dashboard using the manger email to the if then else column.  
Hope it helps…

Make a template column with the value: X Y Z … (for your statuses)  
Then replace each value with the status (New Shipped…)  
Assign this column to the tag.

You can also add emojis next to each status in a seperate if then else column so its more clear

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/b/5b70c72ce0b8e73f0be9bb20b23d72e80fa47c72.png)

---

<div class="post-metadata">

**Author:** ![Food2Soil](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/food2soil/32/659_2.png) [@Food2Soil](https://community.glideapps.com/u/Food2Soil)\
**Post date:** [November 11, 2021, 10:17pm UTC](https://community.glideapps.com/t/lookup-a-relationship-column-based-on-a-criteria/34401/10 "2021-11-11T22:17:25Z")

</div>

Thankyou! I really appreciate it.

---

<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:** [November 12, 2021, 10:18pm UTC](https://community.glideapps.com/t/lookup-a-relationship-column-based-on-a-criteria/34401/11 "2021-11-12T22:18:02Z")

</div>

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