I am trying to fetch items using lookup but seems like it I cannot expand the child people picker column like there is a restriction in which I can't use person field by expanding the child list. Here's my below code:
$.ajax({
url: .../_api/Web/Lists/GetByTitle('APP_NAME')/items$select=*, BookingID/ID,BookingID/Author&$expand=BookingID`,
type: "GET",
dataType: "json",
headers: {
accept: "application/json;odata=verbose",
},
success: (resultData) => {
var listdata = {
accounting: [],
};
console.log(resultData.d.results);
$.each(resultData.d.results, (index, value) => {
console.log(value.HasPPEKit)
listdata.accounting.push({
Author: value.BookingID.Author,
ID: value.BookingID.ID
});
});
When I look in console it is giving an error but if I remove the BookingID/Author
from filter and Author value and try to fetch only ID value using $select=*, BookingID/ID&$expand=BookingID
the ID value is fetching.
Is there a mistake in the API I am doing or is there any other to fetch items from 2 lists?
[and also there are some items which will not match other list. It's like I am using inner join in the list, don't focus on this line much, though].