Currently, I am using an ajax request to access the list items. The fields that are not lookups come as expected but the lookup fields come across as an ID of the object that corresponds to its original list. How can I get the title of the lookup? I have been looking at a lot of post but I cannot figure out how to adapt the things I have found to my code.
My code posted below is just the request and the saving of the data. My ajax code looks like:
jQuery.ajax({
url: siteUrl + "/_api/lists/getbytitle('" + listName + "')/items",
type: "GET",
headers: {
"accept": "application/json;odata=verbose",
},
success: function (data) {
jQuery.each(data.d.results, function (index, item) {
listItem = item;
//creates the new object
var taskHolder = new Task(
item.ID,
item.Title,
item.Name,
item.Client,
item.Assigned_x0020_To,
item.Status
);