Rest API relation field filter not working
We have lots of relational fields and want to filter records based on that. ut when we try to filter records with relation field we get error . W e tried this tewnty cloud and self hosted solution both . Have attached screen shots for the error and query details.
We basically want to filter the relation fields . Please let us know if there is something wrong in the syntax we used.
10 Replies
As we tried this both with twenty cloud and self hosted solution and could not not resolve this and so are unable to proceed with production release because of this.
Would appreciate some quick help.
@azmat I've tested it in your workspace directly, confirming this is working using the field sellerId and not seller.id
On another note, this type of filtering is doable if you're from the side "many" of your relationship. For example, you can filter people based on the company they belong - using the field companyId in your filter, but it is not yet doable to filter the companies based on the people they're attached to. let me know if you have additional question!
@Stephanie Thanks for the inputs. Yes the filter works for sellerId in twenty cloud. But the same filter when I try in our self host env it doesn't work. I created a new field as test field in twenty cloud and our self host instance and we get the same error in both the environments. I am attaching screenshots for better understanding.
@azmat what is the true field that you need to filter please? Is the issue (for your demo) that you cannot filter using the sellerId on the selfhosted instance? Or do you need another field?
Acknowledging there is a need to look into the buyer2Id you shared but asking to prioritize.
So let me break the issue -
1. Currently customer object is related to opportunity object through seller and buyer fields and our automation flow breaks if we cannot filter customer object based on sellerId and buyerId both. So we need the filter to work for both fields sellerId and buyer2Id.
Current Status -
Twenty Cloud - sellerId- working, buyer2Id - not working
Self Hosted - sellerId- not working, buyer2Id - not working
2. Should work in our self hosted environment and cloud as well but priority is self hosted.
@Stephanie
the fact that sellerId works in the cloud could be related to this: https://discord.com/channels/1130383047699738754/1379398545756393663/1379398545756393663
thanks Mike and Azmat, we're looking into this (we're currently checking if this is going to be solved with the upcoming release - later today - or this needs additional work). I'll get back to you likely after the release is done to be able to debug on the newest version. (timeline well understood)
answering on the front ticket !
thank you! I assume this is the ticket you're referring to https://github.com/twentyhq/twenty/issues/12526
GitHub
REST API - Cannot filter using a relation if they are 2 fields poin...
Bug Description Discord thread here We were waiting for the release today but this did not solve the pb despite the PRs on relations. I was able to reproduce on their workspace and ours. Assume we ...
@Stephanie We have found an alternative to the problem. the graphql api is able to filter for relational fields. So we are kind of unblocked as we can update our automation flows to use graphql and proceed.
So the issue is no longer a blocker for us. but do let us know about the issue and when can this be fixed.
@azmat @nogeo my bad regarding the "Front ticket", I was referring to the Support ticket you opened @nogeo (where I shared the link of the GitHub issue indeed). Awesome to see you're unblocked and yes, I'll let you know for sure when this is fixed!