Actions100
- Activity Actions
- Asset Actions
- Authentication Actions
- Collection Actions
- Extension Actions
- Field Actions
- File Actions
- Folder Actions
- Item Actions
- Permission Actions
- Preset Actions
- Relation Actions
- Revision Actions
- Role Actions
- Setting Actions
- User Actions
- Utility Actions
Overview
The "Relation - Get" operation in this node is designed to retrieve relational data from a specified collection within a database. It focuses on fetching related records by using a field that holds the primary key reference to another collection. This operation is useful when you want to access linked or associated data, such as retrieving all authors related to books or any other parent-child relationship between collections.
Practical examples include:
- Fetching all related author details for a list of books.
- Retrieving connected categories for products in an e-commerce database.
- Accessing user profile information linked to user accounts.
Properties
Name | Meaning |
---|---|
Collection Name | Unique name of the parent collection from which to get related data. Examples: "books", "users". |
Field Name | Name of the field in the parent collection that holds the related primary key (database column). |
Output
The output will be JSON data representing the related records fetched based on the specified collection and relational field. The structure typically includes the fields and values of the related entries corresponding to the relation defined by the field.
If binary data is involved in the related records, it would be included accordingly, but this operation primarily deals with relational JSON data.
Dependencies
- Requires connection to a database or API that supports relational queries.
- Needs proper authentication credentials (e.g., an API key or token) configured in n8n to access the data source.
- The node depends on dynamic loading methods to populate options for collections and relational fields (
getCollections
andgetRelationalFields
), which must be supported by the underlying system.
Troubleshooting
- Missing or incorrect collection name: Ensure the collection name exists and is spelled correctly; otherwise, the node may return errors or empty results.
- Invalid field name: The field must correspond to a valid relational field in the collection; otherwise, no related data will be found.
- Authentication errors: Verify that the API key or authentication token is valid and has sufficient permissions.
- Empty results: Could indicate no related records exist for the given field or collection.
- Load options failure: If the dropdowns for collections or fields do not populate, check connectivity and permissions for loading these options.
Links and References
- Refer to your database or API documentation on relational data retrieval.
- Consult n8n documentation on configuring credentials and using dynamic option loading for nodes.