Can't filter chart using field used in a relationship

Feature(s) impacted

Charts in workspaces

Observed behavior

On my company workspace, I want to show a time based chart of orders from that company.
Orders don’t have companyId so I need to filter by users where companyId = currentWorkspaceCompany.
I can’t find the companyId field that I need to filter the users for this chart. I also can’t find other fields used as foreignKey in a relationship.

Expected behavior

Being able to access the users.companyId field like all other user fields.

Context

  • Project name: MyCater
    Capture d’écran 2024-01-25 à 09.14.09

Cheers,

Hello @mathieuh

Filter is only available on 1 level deep

I can’t see the compagnyId field in your users table, that’s why you cannot access it in the filter

One solution would be to create a Smart Field to get the compagnyId into the order collection and then implement the filtering

Hi @nbouliol,

The companyId exists in development but not in production yet. Still, I can’t access user.companyId in the filters.

Hi @mathieuh,

Ok my bad.

Can you please give me the environment name so I can check it on my side ?

Sure,

Env name is Development, not sure how you can access it though.

But you could try on production to access users.trackingId for example, it’s not possible and I think it’s the same issue.

Hello @mathieuh,

I can only see your collections and models definitions, I cant access your UI or datas.

Looking on the Development environment, I see you have a company field on the orders collection, can’t you use this field in the filter ?

Looking on the Development environment, I see you have a company field on the orders collection, can’t you use this field in the filter ?
No, it doesn’t show somehow. Maybe because its a smart relationship?

It seems weird that I can’t access user.companyId though.

Looking on the Development environment, I see you have a company field on the orders collection, can’t you use this field in the filter ?

No, it doesn’t show somehow. Maybe because its a smart relationship?

Okay, since its a smart relationship, you need to implement the filtering yourself.

You can find the related documentation in my first message.

It seems weird that I can’t access user.companyId though.

This i the normal behavior on Forest, the companyId is replaced by the company relation.

I agree it is confusing not being able to filter using this field, thus I will push the feature request

1 Like