In Xano, you can use add-ons to retrieve related data from other tables based on a specific condition. This is particularly useful when you have a one-to-many or many-to-many relationship between your data models. For example, let's say you have a `companies` table and a `campaigns` table, where a company can belong to multiple campaigns, and a campaign can have multiple companies.
Before creating an add-on, it's essential to understand the relationship between your data models. In our example, the `campaigns` table has an array of table references to different companies. This means that a single campaign can be associated with multiple companies, and a company can belong to multiple campaigns.
Xano provides a built-in wizard for creating simple add-ons, which is suitable for most use cases. However, when dealing with more complex data relationships, such as an array of table references, you'll need to create an add-on from the library to have more control over the query.
To create an add-on from the library, follow these steps:
After creating the add-on, you'll be presented with the add-on configuration interface. Here, you can set up the input parameters and define the query to retrieve the related data.
This query will return all campaigns where the `company_id` matches the input `company_id`.
After configuring the add-on, you can use it in your API to retrieve the related data.
By following these steps, you can easily retrieve related data from other tables in Xano using add-ons. This powerful feature allows you to build complex data models and relationships without writing any code.
Remember, Xano is designed to be user-friendly and accessible to both non-technical users and developers. With its visual interface and intuitive features like add-ons, you can quickly build and deploy backend services for your web and mobile applications.
This transcript was AI generated to allow users to quickly answer technical questions about Xano.
I found it helpful
I need more support