I am using REST api to fetch data from a SharePoint list.
I am able to get the lookup fields 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?
The issue was found.
Figured out that I was fetching an item for which all the lookup fields were blank.
I fetched another item, and data was returned as expected.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.