# Is there a way to establish a conditional lookup relationship?

**URL:** <https://connect.superhuman.com/t/is-there-a-way-to-establish-a-conditional-lookup-relationship/24893>\
**Category:** Ask the Community\
**Created:** [August 4, 2021, 9:05am UTC](https://connect.superhuman.com/t/is-there-a-way-to-establish-a-conditional-lookup-relationship/24893 "2021-08-04T09:05:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alan\_Jiang](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/alan_jiang/32/17632_2.png) [@Alan\_Jiang](https://connect.superhuman.com/u/Alan_Jiang)\
**Post date:** [August 4, 2021, 9:05am UTC](https://connect.superhuman.com/t/is-there-a-way-to-establish-a-conditional-lookup-relationship/24893/1 "2021-08-04T09:05:10Z")

</div>

Hi all,

Let’s say I have I’ve created Lookup Table of a, b, c and another Lookup table of x, y, z

Is it possible if let’s say, if the data I’ve collected is a and b then the data will automatically update to X

Example:

if a and b then x  
if a and c then z  
if b and c then y

Thank you!

Best,  
Alan

---

<div class="post-metadata">

**Author:** ![Saul\_Garcia](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/saul_garcia/32/16406_2.png) [@Saul\_Garcia](https://connect.superhuman.com/u/Saul_Garcia)\
**Post date:** [August 4, 2021, 3:48pm UTC](https://connect.superhuman.com/t/is-there-a-way-to-establish-a-conditional-lookup-relationship/24893/2 "2021-08-04T15:48:13Z")

</div>

Hello @Alan_Jiang!  
Would you mind sharing a doc or a screen capture of what you need to happen even if the formulas aren’t there?

What you put as an example appears to need a SwitchIf() but your description makes me think of something else.

---

<div class="post-metadata">

**Author:** ![Alan\_Jiang](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/alan_jiang/32/17632_2.png) [@Alan\_Jiang](https://connect.superhuman.com/u/Alan_Jiang)\
**Post date:** [August 5, 2021, 3:01am UTC](https://connect.superhuman.com/t/is-there-a-way-to-establish-a-conditional-lookup-relationship/24893/3 "2021-08-05T03:01:32Z")

</div>

Hi @Saul_Garcia,

Thank you for your response. Here is an example

> **[Example](https://coda.io/@alan-jiang/example)**

Essentially, I want to create something that if someone selects AB, Column XYZ’s corresponding row will automatically be Y.

Thank you!

---

<div class="post-metadata">

**Author:** ![Kjell\_Pettersen](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/kjell_pettersen/32/21507_2.png) [@Kjell\_Pettersen](https://connect.superhuman.com/u/Kjell_Pettersen)\
**Post date:** [August 5, 2021, 4:45pm UTC](https://connect.superhuman.com/t/is-there-a-way-to-establish-a-conditional-lookup-relationship/24893/4 "2021-08-05T16:45:35Z")

</div>

Hi @Alan_Jiang,

My formula in the XYZ column might not be very elegant, but I think it does what you are looking for. Just know that the formula treats similar combinations such as A,C and C,A as equal.

https://coda.io/embed/086h31qxrd/_suQUO?viewMode=embedplay

```auto
Switchif(
thisRow.ABC.ContainsOnly(A,B),Lookup([Lookup 2],[Lookup 2].[Column 1],"Y"), thisRow.ABC.ContainsOnly(B,C),lookup([Lookup 2],[Lookup 2].[Column 1],"Z"),
thisRow.ABC.ContainsOnly(A,C),lookup([Lookup 2],[Lookup 2].[Column 1],"X"))

```

---

<div class="post-metadata">

**Author:** ![Saul\_Garcia](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/saul_garcia/32/16406_2.png) [@Saul\_Garcia](https://connect.superhuman.com/u/Saul_Garcia)\
**Post date:** [August 5, 2021, 8:52pm UTC](https://connect.superhuman.com/t/is-there-a-way-to-establish-a-conditional-lookup-relationship/24893/5 "2021-08-05T20:52:40Z")

</div>

Thanks for elaborating @Alan_Jiang!

I modified your doc a bit to accomplish what you need.

https://coda.io/embed/oDD9Yjez-g/_suQUO?viewMode=embedplay
