I have a simple fetch I am using to GET
items from a specific SharePoint list.
When I specify what fields I want to GET
with _api/lists/getbytitle('ListName')/items?$select=Name,Item2,Item3,Item4,etc.
I get an error logged in my console telling me:
code: "-1, Microsoft.SharePoint.SPException"
message: {lang: "en-US",…}
lang: "en-US"
value: "The query to field 'Name' is not valid. The $select query string must specify the target fields and the $expand query string must contains Name."
The Name field that I am trying to GET
is lookup column (metadata). So one thing that I tried to bypass this is _api/lists/getbytitle('ListName')/items
, which pulls everything related to that list through and stores it.
When I look through my response to see what all was returned, along with a million different items and values, this actually does return the Name field (but not how I expected/needed it to be stored). It returns to values related to the one field NameID
and NameStringID
.
NameID: 49
NameStringID: "49"
I have done research and cannot find any other related topics, I have never worked with metadata in this sense so I am stumped on getting around this issue.