# How to get MAP to show locations from 2 different tables?

**URL:** <https://community.glideapps.com/t/how-to-get-map-to-show-locations-from-2-different-tables/40478>\
**Category:** Ask for Help\
**Created:** [April 6, 2022, 8:08pm UTC](https://community.glideapps.com/t/how-to-get-map-to-show-locations-from-2-different-tables/40478 "2022-04-06T20:08:42Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Katelyn\_Alberts](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/katelyn_alberts/32/44421_2.png) [@Katelyn\_Alberts](https://community.glideapps.com/u/Katelyn_Alberts)\
**Post date:** [April 6, 2022, 8:08pm UTC](https://community.glideapps.com/t/how-to-get-map-to-show-locations-from-2-different-tables/40478/1 "2022-04-06T20:08:43Z")

</div>

I currently have my Map source linked to a google sheet (salons) that contains many addresses. I also have a second source (professionals) that also has addresses that I want to show on the map view. Is there any way to allow the Map to connect to both sources??

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/8/88f1dcc9faf870e9e94b6b4e7ee92e610679cbcd.jpeg)

---

<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:** [April 7, 2022, 12:57am UTC](https://community.glideapps.com/t/how-to-get-map-to-show-locations-from-2-different-tables/40478/2 "2022-04-07T00:57:38Z")

</div>

I think there’s a way, but you have to use double the rows count for each of those tables.

As you realized, we can only connect to a table at once, so we have to use a centralized table here, let’s call it “Salons x Professionals”. I will go through it step by step and add a demo app later.

- Create a lookup in your users table to return all rowIDs for the Salons table, do the same for Professionals table.

- Use the make array column to join the two above to a single array.

- Create as many rows in advance as you need in the Salons x Professionals table.

- Add a rowID column in the Salons x Professionals table.

- Add a lookup column to return all rowIDs in the same table (an array).

- Use a “find index of element” column to return the index of each row’s rowID in the array of rowIDs above.

- Use a single value column to return the array of rowIDs from the make array column in 2nd step.

- Use a single value column to return the rowID based on the “find index of element” column. Now you have multiple rows of rowIDs combined from both tables.

- Create 2 relations, one from the generated rowID just above to the rowID in the Salons table, one to the Professionals table.

- Create 2 lookups to return the address of each pin through the 2 relations above, and an if then else column. If address from Salons table is not empty, return that address, else return the address from Professionals table.

- Do the same process as above for any further info you want from each table.

- On the map view, you should now have all pins and info from both tables, then finally on the action of each pin: If Salons relation is not empty, show the detail screen for the Salon relation, else show the Professional relation’s details screen.

---

<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:** [April 7, 2022, 1:43am UTC](https://community.glideapps.com/t/how-to-get-map-to-show-locations-from-2-different-tables/40478/3 "2022-04-07T01:43:23Z")

</div>

Here’s a copyable demo.

> **[Join Two Tables](https://panoramic-shoes-1487.glideapp.io/)**

I put some extra things in there, like the JavaScript code to save you some lookup columns, and the Nominatim API to return the coordinates for better pin location.

---

<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:** [April 7, 2022, 2:00am UTC](https://community.glideapps.com/t/how-to-get-map-to-show-locations-from-2-different-tables/40478/4 "2022-04-07T02:00:05Z")

</div>

> [@ThinhDinh](#):
>
> - Add a lookup column to return all rowIDs in the same table (an array).
> - Use a “find index of element” column to return the index of each row’s rowID in the array of rowIDs above.

This is such an amazingly useful technique. These days, any time I create a helper table, I almost always include these few columns at the start of the table.

---

<div class="post-metadata">

**Author:** ![Katelyn\_Alberts](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/katelyn_alberts/32/44421_2.png) [@Katelyn\_Alberts](https://community.glideapps.com/u/Katelyn_Alberts)\
**Post date:** [April 7, 2022, 3:15am UTC](https://community.glideapps.com/t/how-to-get-map-to-show-locations-from-2-different-tables/40478/5 "2022-04-07T03:15:05Z")

</div>

thank you so much Thinh!! This is amazing! ill be back in 3 weeks when ive figured out how to do all these steps lol 🙂

---

<div class="post-metadata">

**Author:** ![Katelyn\_Alberts](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/katelyn_alberts/32/44421_2.png) [@Katelyn\_Alberts](https://community.glideapps.com/u/Katelyn_Alberts)\
**Post date:** [April 7, 2022, 3:16am UTC](https://community.glideapps.com/t/how-to-get-map-to-show-locations-from-2-different-tables/40478/6 "2022-04-07T03:16:06Z")

</div>

i have never used ‘find index of element’! Looking forward to trying this…slightly intimidated!

---

<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:** [April 7, 2022, 3:18am UTC](https://community.glideapps.com/t/how-to-get-map-to-show-locations-from-2-different-tables/40478/7 "2022-04-07T03:18:46Z")

</div>

It’s the combination of RowID + Lookup + Find Array Index - those 3 columns used together give you a dynamically incrementing row number. Such an incredibly useful thing to have, I find new ways to use it almost every day 🙂

---

<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:** [April 7, 2022, 3:27am UTC](https://community.glideapps.com/t/how-to-get-map-to-show-locations-from-2-different-tables/40478/8 "2022-04-07T03:27:27Z")

</div>

> [@Katelyn\_Alberts](#):
>
> thank you so much Thinh, ill be back in 3 weeks when ive figured out how to do all these steps lol

@Katelyn_Alberts here is a video I made a little while ago that demonstrates a very similar technique to the one that @ThinhDinh described above.

---

<div class="post-metadata">

**Author:** ![Katelyn\_Alberts](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/katelyn_alberts/32/44421_2.png) [@Katelyn\_Alberts](https://community.glideapps.com/u/Katelyn_Alberts)\
**Post date:** [April 13, 2022, 4:37pm UTC](https://community.glideapps.com/t/how-to-get-map-to-show-locations-from-2-different-tables/40478/9 "2022-04-13T16:37:00Z")

</div>

thank you darren!

---

<div class="post-metadata">

**Author:** ![Katelyn\_Alberts](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/katelyn_alberts/32/44421_2.png) [@Katelyn\_Alberts](https://community.glideapps.com/u/Katelyn_Alberts)\
**Post date:** [April 15, 2022, 4:00pm UTC](https://community.glideapps.com/t/how-to-get-map-to-show-locations-from-2-different-tables/40478/10 "2022-04-15T16:00:54Z")

</div>

ok that was amazingg!! Thank you so much, it worked perfectly, and i was able to just make a link to the full profiles so i wouldn’t have to copy over a ton of information!

So my ONE problem is that the joined tables list brings over every single professional and salon in the database even if they are not “visible” in the searches bc they don’t have a PAID account. So i only want the paid accounts to show up on the list. Pictures below show the salon and professionals columns that dictate whether or not an account should be seen.

SO, do you know how i can fix this on the map view? 🙏

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/7/87f67c02dad1df7aef5c6815011ceb8d7e245159.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/6/8660764a108166ea4c7dc7f7fcf54c272ffd1d3c.png)

---

<div class="post-metadata">

**Author:** ![Katelyn\_Alberts](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/katelyn_alberts/32/44421_2.png) [@Katelyn\_Alberts](https://community.glideapps.com/u/Katelyn_Alberts)\
**Post date:** [April 15, 2022, 4:20pm UTC](https://community.glideapps.com/t/how-to-get-map-to-show-locations-from-2-different-tables/40478/11 "2022-04-15T16:20:02Z")

</div>

ok i think i got it. I created 2 visibility columns in the salons X professionals tab, then combined them into an if then else, and then filtered the list visibility on the map to the if then else being true!?

---

<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:** [April 16, 2022, 12:32am UTC](https://community.glideapps.com/t/how-to-get-map-to-show-locations-from-2-different-tables/40478/12 "2022-04-16T00:32:24Z")

</div>

Yes, that should be the way!
