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

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??

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.

2 Likes

Here’s a copyable demo.

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.

2 Likes

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.

2 Likes

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 :slight_smile:

1 Like

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

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 :slight_smile:

1 Like

@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.

3 Likes

thank you darren!

1 Like

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? :pray:


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!?

1 Like

Yes, that should be the way!

1 Like