0

I have two lists, List1 and List2.

List1 has a lookup to List2, let's call it List2Lookup.

List2 has a multi-select lookup to itself, as a way to identify other items in the same list as "children", let's call that List2SelfChildren.

Is there a way to get the lookup IDs of the linked items in List2SelfChildren through a REST call to List1 and expanding the List2Lookup field?

If I do a REST call directly to List2, I can get back

{
    ID: 123,
    Title: "Something",
    List2SelfChildrenId: {
        results: [23, 56]
    }
}

where the results array is just the item IDs of the items selected in the lookup field, and again, that's all I really need to get, I don't need to expand any properties for items 23 or 56.

I've tried

/mysite/_api/web/lists/getbytitle('List1')/items(7)?$select=ID,Title,List2Lookup/ID,List2Lookup,Title,List2Lookup/List2SelfChildrenId&$expand=List2Lookup

but that doesn't work.

I've also tried

$select=List2Lookup/List2SelfChildrenId/results&$expand=List2Lookup

$select=List2Lookup/List2SelfChildren/Id&$expand=List2Lookup

$select=List2Lookup/List2SelfChildren/Id&$expand=List2Lookup,List2Lookup/List2SelfChildren

$select=List2Lookup/List2SelfChildrenId&$expand=List2Lookup,List2Lookup/List2SelfChildren

and none of them work.

Is there some way for me to get those lookup IDs from the item in List2 by expanding the lookup from List1?

1
  • 1
    Unfortunately, No. You can extend/expand lookup column from lookup in SharePoint. So, you cannot get those details in single REST API call. May 25, 2023 at 16:15

1 Answer 1

0

Unfortunately, this is not possible with single SharePoint REST API call. You can extend/expand nested lookup column details from lookup column in SharePoint list.

This is a known limitation of SharePoint lookup columns.

SharePoint lookup columns support simple column types for expanding via SharePoint REST API. For example:

  • Single line of text
  • Number
  • Date and Time

Similar thread: Nested lookup columns in a list

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.