Actions8
Overview
This node enables interaction with PocketBase collections, specifically allowing users to create records that include file uploads. It is useful when you want to add new entries to a PocketBase database and simultaneously upload associated files (e.g., images, documents) linked to specific fields in the record.
Common scenarios include:
- Uploading user profiles with avatar images.
- Creating product entries with multiple attached images or documents.
- Adding any record where some fields require file attachments alongside regular data.
For example, you might create a "users" collection record with fields like "name" and "email," while uploading an avatar image file to the "avatar" field.
Properties
| Name | Meaning |
|---|---|
| Collection | The name of the PocketBase collection where the record will be created. |
| Fields Data | Regular field data for the record as key-value pairs. Each entry specifies a field name and its value. |
| Binary Property | The name of the binary property in the input data that contains the files to upload. |
| File Field Names | Comma-separated list of field names in the PocketBase collection that will receive the uploaded files. |
Output
The output JSON contains the newly created record returned from PocketBase after successful creation with files. This includes all fields of the record as stored in PocketBase, including any metadata added by the service.
If multiple files are uploaded, they are associated with their respective fields as specified. The output does not contain raw binary data but reflects the record's state post-upload.
Dependencies
- Requires a valid PocketBase instance URL and authentication credentials, either via email/password or an API token.
- Uses the official
pocketbaseJavaScript client library. - Requires n8n credentials configured with the PocketBase API URL and authentication details.
- Input binary data must be provided in the specified binary property containing the files to upload.
Troubleshooting
- Authentication errors: If authentication fails, verify that the provided email/password or API token is correct and has sufficient permissions.
- File upload issues: Ensure the binary property name matches the input data containing files. Also, confirm that the file field names correspond exactly to the fields in the PocketBase collection expecting files.
- Field data errors: Make sure all required fields in the collection are provided in the "Fields Data" property; missing mandatory fields may cause record creation to fail.
- Invalid JSON: The node expects well-formed JSON for field values; malformed JSON strings can cause errors.
- API limits or network issues: Network failures or API rate limits may cause intermittent errors; retry or check connectivity.