ERPNext HRMS icon

ERPNext HRMS

Work with ERPNext/Frappe HRMS v15-v16 documents and methods

Custom DocType → Get Many

AI-generated

Summary

Retrieve multiple documents from a specified Custom DocType in ERPNext using the chosen API version, applying optional filters, field selection, sorting, and pagination controls.

Inputs

  • API Version — Select the Frappe REST API version to query (v1 or v2). Defaults to v1.
  • Custom DocType (required) — Specify the exact name of the custom DocType to query documents from.
  • Fields — Provide a comma-separated list or JSON array of document fields to return, e.g., name,employee_name,status. Defaults to ["name"].
  • Filters JSON — JSON array or object specifying Frappe filters to apply, for example [["status","=","Active"]] or {"employee":"HR-EMP-0001"}. Defaults to empty array meaning no filters.
  • Return All — Choose whether to fetch all matching documents or limit the number of returned documents. Defaults to false.
  • Limit — If 'Return All' is false, limit the number of documents returned (1-1000). Defaults to 50.
  • Order By — Specify the field and direction to order the results, e.g., "modified desc". Defaults to "modified desc".

Output shape

a list of JSON objects representing documents matching the criteria

If 'Return All' is enabled, the node automatically pages through results to retrieve all documents up to a maximum of 1000 per request page; otherwise, the number of documents returned respects the 'Limit' parameter. Returned document fields match the specified 'Fields' input. On failure, errors are output per item if 'Continue On Fail' is enabled.

Examples

Example 1: Retrieve all 'Job Applicant' documents with status Active, returning name and employee_name fields

Set Resource to Custom DocType, Custom DocType to 'Job Applicant', Filters JSON to [["status","=","Active"]], Fields to 'name,employee_name', Return All to true

Links

Discussion