Actions8
Overview
This node integrates with PocketBase to perform operations on records within specified collections. The "Get Many" operation retrieves multiple records from a given collection, supporting filtering, sorting, pagination, and relation expansion.
Typical use cases include:
- Fetching lists of records matching certain criteria (e.g., all active users created after a specific date).
- Retrieving related data in one request by expanding relations (e.g., fetching orders along with customer details).
- Paginating through large datasets or retrieving all records at once.
Example: Retrieve up to 100 active products sorted by creation date descending, including expanded category information.
Properties
| Name | Meaning |
|---|---|
| Collection | The name of the PocketBase collection to query (e.g., "users", "orders"). |
| Expand Relations | Comma-separated list of related fields to expand in the results (e.g., "turma,turma.colegio"). |
| Return All | Boolean flag indicating whether to return all matching records or limit the number of results. |
| Limit | Maximum number of records to return if not returning all (minimum 1). |
| Filter | Filter expression to narrow down results (e.g., status = "active" && created > "2022-01-01"). |
| Sort | Sorting parameter specifying order of results (e.g., -created,name for descending created date). |
Output
The output JSON structure for the "Get Many" operation includes:
total: Total number of matching records.page: Current page number (always 1 in this implementation).perPage: Number of records per page (limit).totalPages: Total number of pages available.items: Array of record objects retrieved from the collection.
If relation expansions are requested, related data is included inside each record under an expand property.
No binary data output is produced by this operation.
Example output snippet:
{
"total": 120,
"page": 1,
"perPage": 50,
"totalPages": 3,
"items": [
{
"id": "abc123",
"name": "Sample Record",
"expand": {
"relatedField": { ... }
}
},
...
]
}
Dependencies
- Requires a PocketBase instance URL and authentication credentials:
- Either email/password for admin authentication, or
- An API token for token-based authentication.
- Uses the official
pocketbaseJavaScript client library (dynamically imported). - Requires n8n credential configuration providing the PocketBase URL and credentials.
- No additional environment variables needed beyond the credentials.
Troubleshooting
- Authentication errors: If authentication fails, verify that the provided email/password or API token is correct and has sufficient permissions.
- Relation expansion warnings: If some requested expansions fail, a warning is logged indicating which relations could not be expanded. This often relates to API view rules or permissions on related collections.
- Filter syntax errors: Invalid filter expressions will cause errors. Consult PocketBase API documentation for correct filter syntax.
- Limit and pagination: When
Return Allis false, the node limits results to the specifiedLimit. To retrieve more records, enableReturn All. - Network or API errors: Any communication issues with the PocketBase server will throw errors; ensure the server URL is reachable and the service is running.