Custom data source, filtering by linked fields

I have a custom data source:

DiglasID and Šifra are linked fields in BOOKING table. When I send a filter that is for linked fields I get the feedback that there are no values that fit the given filter although I know that they exist. For example:

let filter = “FILM DATA - DiglasID(eq)010027”;
const CB = await doo.extensions.customDataSource.getData(“ImportFilter”, {
filter,
limit: 99999
});
console.log(CB.data);

CB.data will contain no records. But if I send the filter for a field that is not linked I will get the correct response. For example:

let filter = “BOOKING - CampaignBookingID(eq)010585c5-4214-452e-aa38-91d61b602261”;
const CB = await doo.extensions.customDataSource.getData(“ImportFilter”, {
filter,
limit: 99999
});
console.log(CB.data);

will have the corresponding record in the response.

Is there a way how I can filter by linked fields in custom data source?

Hi,

Check the column name in the result

First, print the entire CB.data[0] without applying any filter, and check what the name and structure of the DiglasID field looks like:

const CB = await doo.extensions.customDataSource.getData('ImportFilter', { limit: 1 });
console.log(CB.data[0]);

Look for whether DiglasID is returned as an object or just a string/ID. It might look like this:

{
  "FILM DATA - DiglasID": {
    "id": "010027",
    "name": "Some Text"
  }
}

If that’s the case, then a filter like FILM DATA - DiglasID(eq)010027 won’t work because eq tries to compare the entire object—not just the id.

Regards, Filip

The code you have given me will not work. Maybe I did not send enough information. I will try to provide more info on my outputs.
For the code:

image

I get the following output:

image

Inside the BOOKING I get an array of objects. Here is an example of the object with the index 0 (CB.data.BOOKING[0):

image

I hope this provides more information about my problem and I again ask the question. Is it possible to filter by “FILM DATA - DiglasID” and “KONTO - Sifra” fields