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
This node is designed to interact with a "Role" resource, specifically to list roles from a data source. It allows users to retrieve multiple role entries with flexible options such as filtering, sorting, pagination, and aggregation. This node is beneficial in scenarios where you need to fetch user roles or permissions data for further processing, reporting, or integration with other systems.
Practical examples include:
- Retrieving all user roles to display in an admin dashboard.
- Fetching a limited number of roles with specific filters applied.
- Exporting role data into CSV, JSON, or XML formats for external use.
- Performing aggregate calculations like counting the number of roles or finding the maximum value of a field.
Properties
Name | Meaning |
---|---|
Return All | Whether to return all results or only up to a given limit. |
Limit | Maximum number of results to return (used if "Return All" is false). Range: 1 to 100. |
Split Into Items | Whether to output each element of an array as its own item. |
JSON/RAW Parameters | Whether the query and/or body parameters should be set via the UI key-value pairs or by providing raw JSON. |
Body Parameters | Body parameters as JSON or RAW input (used if JSON/RAW Parameters is true). |
Additional Fields | Collection of optional fields to customize the request, including: |
- Aggregate | Aggregation functions to perform calculations on a set of values, returning a single result. Functions include Average, Average Distinct, Count, Count Distinct, Maximum, Minimum, Sum, and Sum Distinct. |
- Binary Property for Export Data | Name of the binary property to download exported data to. |
- Deep (JSON) | Nested relational dataset parameters as JSON for deep querying. |
- Export | Format to save the API response to a file. Options: CSV, JSON, XML. |
- File Name for Export Data | File name for the exported data without extension. |
- Fields | Control which fields are returned in the response objects. |
- Filter (JSON) | JSON filter conditions to select items in the collection. |
- Group By | Field(s) to group by when running aggregation functions, e.g., "author,year(publish_date)". |
- Meta | Metadata to return in the response. |
- Offset | Number of items to skip when fetching data (for pagination). |
- Search | Filter items containing the given search query in any of their fields. |
- Sort | CSV of fields used to sort the returned items. Prefix with "-" for descending order; "?" for random sorting. |
Output
The node outputs JSON data representing the list of roles retrieved according to the specified parameters. The structure typically includes an array of role objects, each containing fields as requested or defaulted by the API.
If export options are used, the node can output the data as a downloadable binary file in CSV, JSON, or XML format, stored under the specified binary property name.
Dependencies
- Requires connection to an external API or service that manages the "Role" resource.
- Needs appropriate API authentication credentials configured in n8n (e.g., an API key or token).
- Supports advanced querying features depending on the API capabilities, such as filtering, sorting, aggregation, and exporting.
Troubleshooting
Common Issues:
- Incorrect or missing authentication credentials may cause authorization errors.
- Providing invalid JSON in the "Body Parameters" or "Filter" fields can lead to parsing errors.
- Requesting more items than allowed by the API limit may result in truncated responses or errors.
- Using unsupported field names in "Fields", "Sort", or "Group By" may cause the API to reject the request.
Error Messages:
- Unauthorized / Authentication Failed: Check that the API credentials are correctly set and valid.
- Invalid JSON: Verify the syntax of JSON inputs in "Body Parameters" and "Filter".
- Field Not Found: Ensure that field names used in properties exist in the Role resource schema.
- Limit Exceeded: Adjust the "Limit" property to comply with API constraints.
Links and References
- Refer to the external API documentation managing the Role resource for detailed information on supported query parameters, aggregation functions, and export formats.
- n8n documentation on using JSON parameters and handling binary data for exports.