# Setting up a relation column and a lookup column

**URL:** <https://community.glideapps.com/t/setting-up-a-relation-column-and-a-lookup-column/58639>\
**Category:** Ask for Help\
**Created:** [March 1, 2023, 5:49pm UTC](https://community.glideapps.com/t/setting-up-a-relation-column-and-a-lookup-column/58639 "2023-03-01T17:49:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![v\_wadhawan](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/v_wadhawan/32/35245_2.png) [@v\_wadhawan](https://community.glideapps.com/u/v_wadhawan)\
**Post date:** [March 1, 2023, 5:49pm UTC](https://community.glideapps.com/t/setting-up-a-relation-column-and-a-lookup-column/58639/1 "2023-03-01T17:49:01Z")

</div>

sir,  
I have updated app which you may peruse at [https://pdvi-hhm.glideapp.io/](https://pdvi-hhm.glideapp.io/)  
I used two tables the at the  
link [https://docs.google.com/spreadsheets/d/1kwV13i36-c5\_H03zZ-6tucTuyIDuYjNbS8OpijB0AY8/edit?usp=sharing](https://docs.google.com/spreadsheets/d/1kwV13i36-c5_H03zZ-6tucTuyIDuYjNbS8OpijB0AY8/edit?usp=sharing)  
In data editor I have added a booking office email column in the HHM table and the 2nd table bookings contain 2 columns ‘controlling office’ and ‘booking office email’ which includes all entries in HHm\_2 table but excludes multiple entries in the column.  
I used the choice component and wrote to choice column in the ‘bookings’.

 ![2023-03-01](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/f/0f65323748632128323422a8faa1340cb8847153.jpeg)where in I created a relation column 'Bookings" between controlling office in HHm\_2 and booking office email . further I created a look up column for relation bookings. my lookup column is not being used anywhere?  
Although the app serves the purpose to some extent but I fail to comprehend ;  
1.whether the Pension Paying office which are chosen by choice component are due to the relation column bookings in the table are due to the controlling office column in the table. i.e. if I remove the relation column will I get the same result.  
2.Why my lookup column not working and how to remove the controlling offices column by setting a relation and a lookup column and . in short how to set the lookup column in the tables ?.  
3. In which table relation column and lookup column are required to be set in the instant case and and as a general rule.  
I’m stuck up.  
Pl guide  
v wad

---

<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:** [March 2, 2023, 1:43am UTC](https://community.glideapps.com/t/setting-up-a-relation-column-and-a-lookup-column/58639/2 "2023-03-02T01:43:17Z")

</div>

> [@v\_wadhawan](#):
>
> 1.whether the Pension Paying office which are chosen by choice component are due to the relation column bookings in the table are due to the controlling office column in the table. i.e. if I remove the relation column will I get the same result.

I’m sorry, but I don’t understand what you are asking here.

> [@v\_wadhawan](#):
>
> 2.Why my lookup column not working and how to remove the controlling offices column by setting a relation and a lookup column and . in short how to set the lookup column in the tables ?.

It’s not working, because your relation column is empty. Can you show how your relation is configured please?

> [@v\_wadhawan](#):
>
> 1. In which table relation column and lookup column are required to be set in the instant case and and as a general rule.

Relations and lookups can be added to any tables, and should be added where ever they are needed.

---

<div class="post-metadata">

**Author:** ![v\_wadhawan](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/v_wadhawan/32/35245_2.png) [@v\_wadhawan](https://community.glideapps.com/u/v_wadhawan)\
**Post date:** [March 2, 2023, 5:42pm UTC](https://community.glideapps.com/t/setting-up-a-relation-column-and-a-lookup-column/58639/3 "2023-03-02T17:42:08Z")

</div>

Sir,  
Im sorry I could not make things clear to you.  
In fact, I have two tables’ 1. bookings and2. HHm\_2.  
bookings contain 3columns  
1.Controlling office and  
2.booking office email.  
and choices column to write the choice component.  
HHm\_2 contains among others main columns as under:  
Place  
NO. OF ROOMS\_FLATS  
CONTROLLING OFFICE  
HOLIDAY HOME ADDRESS  
TELEPHONE/MOBILE  
booking office Email  
controlling office and booking office email columns are same in both the tables with a difference that in HHm\_2 table there are some repetitions of the Columns data some ‘Places’ have more one controlling offices and so emails.  
Further I created a bookings tab in the app where I fetched data from bookings using choice component: source-bookings; values -booking office email; display as ‘controlling office’ so that all the controlling offices shown- when any one is clicked the relevant ‘booking office email’ is written in choice column in bookings and appropriate email is displayed in the app through action text as per image below;

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/f/8f3c50ebaa88787fa973492abb8a73b351651cd7.png).  
Else where in the community I was advised that if Controlling office is not absolutely necessary, I can set it to write the rowID to the cell containing the choice and relate that to the table and retrieve the email using a look up column.  
I created a relation column in bookings table “Bookingoffices” and configured it to the controlling office column in HHm\_2. which no doubt seems empty. I also created a lookup column in the same table that looks up the relations column. I was trying that and I failed.  
As per your comments it is not working because relation is empty. what should I do to populate it so that lookup column works?  
thanks  
vwad

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [March 2, 2023, 6:12pm UTC](https://community.glideapps.com/t/setting-up-a-relation-column-and-a-lookup-column/58639/4 "2023-03-02T18:12:29Z")

</div>

Relations work when both values match exactly. I’m not sure so follow, but are you trying to link an BookingEmail to a Controlling office? If so, those are not matching values. A matches A, but A does not match B.

---

<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 6, 2023, 11:22am UTC](https://community.glideapps.com/t/setting-up-a-relation-column-and-a-lookup-column/58639/5 "2023-03-06T11:22:41Z")

</div>

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