Filtering Map pins using a Many to Many relationship

Hi there ,

So let me explain my app shortly: it is an app that displays places on a google map. These places are selected by categories (food, workshops, etc) and eco-responsible criteria (biologique, équitable, etc) (app is in french by the way ^^).

Now to do this I have created 2 tables:

  • table “Commerce” has all the data concerning the places themselves including the locations

  • table “Crit” is a list of eco-responsible criterias

In order to join these two tables which have a many to many relationship, I created a 3rd table called “Crit Items”:

Now, my app works very well. A created 4 views. One with the map with every place. One with a list of every place. One where you can select your place by its category and the last one where you can select your place by its eco-responsible criteria.

Let me show you:
Map view

List view

Categorie view

Eco-responsible criteria view:

Now I’ve created an action THAT ONLY SHOWS THE PLACES ON THE MAP BY THERE CATEGORY.
3X_e_3_e3446adb2c8eb6a7a6eed663f64f3eed4053192b.png

That was easy to do as this action is set to use the Commerce table which contains all the data needed to make this action work. The action “go to another view within this app” using this expression: LINKTOFILTEREDVIEW(“Carte”, [Catégorie] = [_THISROW].[Catégorie])

Now, that is my question (at last ^^):

Is it possible to do the same thing but using the “Crit Items” table ?

The goal is to display the places on the map that only satisfies the selected criteria.

I tried a lot of expressions but none seemed to work. I’ve even tried to duplicate the name and location entries in the Crit Items table and use an expression similar to the one I use to select by category. Did not work as well.

So I hope I was clear enough to you all but if I was not, feel free to ask any question you want.

Thank you for reading me.

Ced

0 2 122
  • UX
2 REPLIES 2

Hi @CedLuck

So if I understand correctly you want to display a filtered list of items from the Crit Items table and filter them by [Critere]. Here’s a couple of suggestions.

1 = Easy option. Use Format Rules to colour code or use different icons to identify [Critere] and [Critere ecoresponsable]

2 = Better but more complicated. Setup a dashboard with two views. The first view will contain two dropdown menu options for [Critere] and [Critere ecoresponsable]. You need to create a seperate table whos only job is to allow you to choose [Critere] and [Critere ecoresponsable]. Then you create a slice forumla that looks at thses two dropdowns and comes up with a filter list of the Crit Items table. Then you create a map view that looks at this slice.

Hope this helps. Not sure if there is an easier option.

Simon@1minManager.com

Hi @1minManager

Thank you for your reply. You didn’t give me the exact solution but I was greatly inspired by your 2nd suggestion. (first suggestion couldn’t be applied as I already had some color and icon format by category on my main map)

I, therefore, manage to achieve my goal . Here what I did:

  • I created 8 slices of the Crit Items table in which I used the [Crit ID] row to select the criteria:


Then I create 8 views using those slices:

Each view uses the [Location] row (Localisation in french) which was added in the related slice to set up the marker on the map.

Now I wanted to link these views in a specific place on the Commerce_details view:

Now the question is: how to connect the “sliced” view with the related criteria:

I created an action where the target specifies the view I want with this expression

So the trick is in fact to give the view the exact name of the [Crit ID]:
3X_5_7_57d0c59556d82c109c71cbbe6c1301a826ed04e2.png

What happens is that you have a whole lot of views that you can format, like this one:
Map of the places selected by the criteria “Matières naturelles”:

So thank you very much for your contribution. I think there’s a better way to do this as I am sure that you can navigate from one table to another when two tables are joined properly. Just have to find the proper expression. But I’m happy with the result I have and I hope my experience can help someone else.

Ced

Top Labels in this Space