I am using REST api to fetch data from a SharePoint list.
I am able to get data using this query:
requestUri = "/_api/lists/GetByTitle('Data')/items?$select=ID,Title,Department/Title&$expand=Department
However when I use this query:
requestUri = "/_api/lists/GetByTitle('Data')/items(6)"
Or this query:
requestUri = "/_api/lists/GetByTitle('Data')/items?$select=ID,Title,Department/Title&$expand=Department&$filter=ID eq 6"
I am not getting the data from the lookup fields.
What could be going wrong here?
_deferred
entrydata.d.results[0].Department.Title
. Also check if there is any department selected for item with ID=6.