[Rest API] Fetch data in linked doctype

I have 2 doctypes, Agency and Category. Agency has field that linked to Category, meanwhile Category is a standalone. I need to fetch data in Agency along with category_name, not just the name/id. This is what I’ve tried:


This works if Category is child of Agency. But I need Category to be a standalone. Is this possible?

Hi @hikmahaz,

I think is not possible if the Category is not linked with Agency because of how could to get a record without any link.


so if Category is not a child doctype it’s not possible? ok, thanks

Because it’s not connected to each other.


but Agency has a field that linked to Category tho. that alone is not enough?

Category field in parent doctype of Agency or child doctype of Agency?
If a link in the child doctype of the Agency then the name of the child table?

Maybe, if possible then there is more complexity to get data.


Agency: agency_name (data), address (text), category (link to Category)
Category: category_name (data), priority (int)

those were the fields on each doctype

Hi @hikmahaz,


only category id display only.

Otherwise, first, fetch category_name and priority from Category in a custom field in Agency Doctype then API set like