Displaying nested properties that can be sorted and filtered

Hi everyone,
I wasn’t able to find anything related to my question in the docs, so I was wondering if anyone could give me a hint.

I have some nested properties in my mongoose schema, e.g.

  'field': {
    'nestedField': {
      'date': Number,
      'age': Number,
      'status': String,
    },
  },

and I want to display them as a flat structure in collections table as a separate fields. I’d also like to preserve the ability to sort and filter the fields, so if I accomplish this using smart fields, I won’t be able to do that. Any advice will be highly appreciated.

Hi @Dmytro,

Welcome to the Forest Admin Community !

I’m not sure to understand your need but maybe you could take a look at ForestAdmin smart collections.

This way you could build your own collection with a flatten nested field and define by yourself the search and filter.

I hope this help

Hello, Valentin. Thank you for your advice. I implemented this using smart fields!

@lamatt_v, may I also ask you about this topic:

https://docs.forestadmin.com/documentation/reference-guide/routes/default-routes#relationship-routes

GET /forest/{modelName}/{id}/relationships/{hasManyRelationName}.csv ⟶ Download and export of an has many relationships

I have route GET ‘/games/:recordId/relationships/users’ (which works fine) but when I add GET ‘/games/:recordId/relationships/users.csv’ it doesn’t seem to work. Adding a smart action for this doesn’t work either. Do you have any examples how this can be implemented?

Thank you so much for your assistance.

Hello @Dmytro :wave:

What do you mean by it doesn't seem to work ?

This call is performed when you try to export the data from a related data section of a record.

Here is an example:

Here it will target the said url, because I’m trying to exports the activity logs (the relationShip) from a user.

Steve.