Display data via smart relationship based on two relationship

Feature(s) impacted

smart relationship

Observed behavior

We have this structure :
a place has multiple diagnoses
a place has multiple diagnoses_categories
a diagnoses has one diagnoses_categories
a diagnoses_categories has multiple diagnoses

On places collection we display diagnoses_categories has a related data and in diagnoses_categories collection we display all diagnosis has smart relationship

When going through places collections and her diagnoses_categories we want to display only the diagnoses related to diagnoses_categories and places

For now we know how to get the diagnoses_categories id (via request.params.id) but we are unable to get the places id. Is there a solution to this problem ?

Expected behavior

We can display our data based on two params : the direct relationship and another data which come from naviguation

thank you

Failure Logs

Context

  • Project name: sergic
  • Team name: gestion
  • Environment name: recette
  • Database type: postgresql

Hi @mduhez :wave: unfortunately what you asking for does not exist yet. I will push your request on our product board.
In order to try to find a workaround can you give us more details about your database schema please :pray:

Thank you for your response

What we need :

collection places → related data diagnoses_categories (filtered by places_id, no problem) → smart relationship diagnoses (filtrered by categories_id and places_id, there is a problem with the places_id)

The database schema is slightly different from what I had in mind:

  • Diagnoses has a foreign key to on diagnoses_category and to one place
  • In place there is a smart field for diagnoses_category_id but no link in database, we use a smart relationship to retrieve all the categories via a findAll request
  • in diagnoses_categories routes, we create a smartrelationship which use diagnoses_category_id to retrieve diagnoses - this is where we need a place id to retrieve correct data

Hi @mduhez :wave: thank you for your precision, it will help for the future.
Unfortunately I can’t see any workaround.
As I said, your request is pushed to our product board.
Thank you again for you feedback.