Overview
This node integrates with the ERPNext Chinese version API, specifically allowing users to query document types (DocTypes) and retrieve multiple records matching specified criteria. The "Doctype查询" resource with the "Get Many" operation enables fetching many documents of a selected DocType, optionally filtered by search keywords, fields, and custom filters.
Common scenarios include:
- Retrieving customer or sales data from ERPNext for reporting or automation.
- Extracting item lists or inventory details based on dynamic filters.
- Fetching subsets of documents for further processing in workflows.
Practical example:
- A user wants to get all customers whose country is "China" and limit results to 100 entries.
- Another use case is searching DocTypes by keyword "Sales" and retrieving specific fields like invoice number and date.
Properties
| Name | Meaning |
|---|---|
| DocType 搜索关键字 | Input keyword to search DocTypes with fuzzy matching. Example: "Customer", "Sales", "Item". |
| 文档类型 Name or ID | Select a DocType from a dropdown list loaded dynamically based on the search keyword, or specify an ID via expression. |
| 返回全部 | Boolean flag indicating whether to return all matching results or limit the output. |
| 限制数量 | Maximum number of results to return when not returning all. Minimum value is 1; default is 50. |
| 选项 | Additional options including: - 字段名称或ID Names or IDs: Multi-select list of field names or IDs to return for each document. - 筛选条件 Filters: Multiple custom filter conditions where each filter specifies a field, operator (e.g., equals, greater than), and value. |
Output
The node outputs JSON data containing an array of documents retrieved from the ERPNext system according to the specified DocType and filters. Each document includes the requested fields as key-value pairs.
If binary data were supported, it would typically represent file attachments or similar content, but this node focuses on JSON document data only.
Dependencies
- Requires an API key credential for authenticating with the ERPNext Chinese version API.
- Depends on dynamic loading methods to fetch available DocTypes, fields, and filters from the ERPNext instance.
- No additional external services beyond the ERPNext API are required.
Troubleshooting
- Resource or Operation Not Found: If the node throws an error stating the resource or operation is not implemented, verify that the "resource" parameter is set to "documentQuery" and the operation to "getAll".
- Empty Results: Ensure the DocType is correctly selected and that any filters applied match existing data.
- API Authentication Errors: Confirm that the API key credential is valid and has sufficient permissions.
- Invalid Field or Filter IDs: When specifying fields or filters via expressions, ensure the IDs correspond to actual DocType fields.
- Limit Exceeded: If too many results are requested without enabling "returnAll", the node will limit output to the specified "limit".
Links and References
- ERPNext Official Documentation
- n8n Expressions Documentation
- ERPNext API Reference (general ERPNext API docs, applicable concepts)