I have simple SharePoint custom list. It has 3 columns,
1) Title
2) Manager (Person or group type)
3) Type (Managed metadata - single value).
Now i tried to get the value of the list items. However, i am not able to get the values in a single REST API call.
If I use the standard _api/web/lists/GetByTitle('Test')/items(1)
and use $expand
, i get the person name but taxonomy guid.
https://sitecollectionurl/_api/web/lists/GetByTitle('Test')/items(1)?expand=Manager&$select=Title,Manager/Title,Type
If I use the CAML query with REST API as below, then i get the taxonomy column label but i get the user's id value and not title.
var caml = "<View><Query><Where><Eq><FieldRef Name='ID'/><Value Type='Number'>1</Value></Eq></Where></Query></View>";
var requestData = { "query" :
{
"__metadata":
{ "type": "SP.CamlQuery" }
, "ViewXml": caml
}
};
$http({
method: "POST",
url: "https://sitecollectinonurl/_api/web/lists/GetByTitle('Test')/GetItems",
data: requestData,
headers: { "Accept": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" , "X-RequestDigest": document.getElementById("__REQUESTDIGEST").value }
});
Is there any way, I can get both the person column and taxonomy column in a single REST API call ?