Domanda

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?

È stato utile?

Soluzione

Try your endpoint like:

requestUri = "/_api/web/lists/GetByTitle('Data')/items(6)?$select=ID,Title,Department/Title&$expand=Department
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top