How to filter table columns using a bridge-entity to query data in related tables

Are you looking for help?

This is a support forum for reporting issues related to Backendless services. Please note that due to our support policy we cannot provide you help with debugging your code, consulting in regards to any language or third-party library usage. For this kind of questions we recommend using more appropriate forums like Stack Overflow.

In order to suggest you a quality solution, we shall usually ask you to provide the details mentioned below first. Including them into your topic right away helps us to start investigating your issue much faster.

In case you have a suggestion or an idea, the details below are not always required, though still any additional background is welcome.

Backendless Version (3.x / 5.x, Online / Managed / Pro )

I’m looking for a way to filter the columns returned by a get rest-api query to a bridge-entity involved in two 1-many relationships with two tables? I’m able to get data but I’m over-querying data.

Client SDK (REST / Android / Objective-C / Swift / JS )

Application ID

Expected Behavior

Please describe the expected behavior of the issue, starting from the first action.

1.I’m looking for a way to filter the columns returned by a get rest-api query to a bridge-entity involved in two 1-many relationships with two tables? I’m able to get data but I’m over-querying data.
2. I want to specify data columns from related tables that should be returned by a query
3.

Actual Behavior

Please provide a description of what actually happens, working from the same starting point.
I’m getting all the data from all table columns
Be descriptive: “it doesn’t work” does not describe what the behavior actually is – instead, say “the request returns a 400 error with message XXX”. Copy and paste your logs, and include any URLs.

Reproducible Test Case

Please provide a simple code that could be run in a new clean app and reproduce the issue.

If the issue is more complex or requires configuration, please provide a link to a project on Github that reproduces the issue.

Hi, @Admire_Mhlaba

You need to specify data relation column and the desired column from the related table in the GET request. As example:

property=reCountry.IndepYear&property=reCountry.LocalName

Response I got:

	{
		"___class": "AllColumns",
		"IndepYear": 1975,
		"objectId": "1",
		"LocalName": "Angola"
	}


Good day, thank you for being kind enough to respond to my inquiry but where exactly do I specify these columns because after selecting the data relation column from the dropdown, I cannot enter anything else. The request URL is greyed out, meaning you cannot edit that either. Kindly help by indicating the place I need to specify columns I need returned using the attached image.


Hi once again, I managed to add columns from data related columns as depicted in the image but the query does not filter data. I only requested BookId.BookName and BookId.BookPrice but I’m getting everything instead, kindly help me resolve this issue.

Try to write BookId.BookName as BookNameFromRelation at Columns/Properties
Also, you could change BookNameFromRelation for any other name for the property.


Good day, thank you for your help and pointers. I discovered something quite peculiar, if I specify data relation column, and filter by Columns/Properties, it does not work, data is not filtered as needed but if I remove the data relation column then, filtering works and returns only data columns requested by the query or data specified by Columns/Properties.

Good day, thank you for your kind help, apparently specifying the data relation column is the reason why filtering was not working. I only specified Columns/Properties and it worked as it should just like you advised me to.

1 Like