Foreign Table

Basic overview of querying and filtering through Foreign Tables

Let's say you have a table called "Post" and each post have a "Category". With a simple query you can return both table with just 1 API call, and you can also limit the number of columns you wish to return to save on data transfer costs.

For that you need to first initialize that call in the API connector just like with every other. You can query and filter down several levels but this guide only shows the basics.

First let's initialize the call:

Same as before, but here we actually need to specify the Data we wish to return.

Let's break it down:

First we add the columns for the "Post" Table, we can just insert a "*" here to return everything. after we add a comma, and now we can add the name of the column for the Foregn Table we have, in this case "category_ft" and inside a bracket we can add the columns we'd like to return as well. We can also use an asterisk as well.

If you wish to go down more levels, so let's say the "Category" table also have "user" which is a "User" table, you can add after the 'select': *,category_ft(name,id,user(*)). This would yield this result:

After you have the basic setup done. Now we can setup the plugin this way. Let's add a dropwdown to filter for the Categories.

This will show the "Category" table so we can dynamically filter the API call later.

Next step to setup the actual "Post" Data element. Here we can add the filter for the query, so that we specify that the name of the foregn table has to match the dropdown's value.

As you can see we're returning the same table, and the same columns as we've specified in the API connector.

For the filter we can add the name of the column for the foreign table followed by a dot and after the name of the column inside the foreign table we wish to filter on.

With everything setup here's the feature.

Last updated