Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SharePoint REST request to select all columns and to expand lookup columns

I have a SharePoint(Online) list which has around 50 columns. Out of which 6 are lookup columns. I am trying to write a REST query to get all the columns including the expansion($expand) of lookup columns. Specifying all the columns in '$select' will make the REST query URL to exceed the limit allowed by IE. But to expand the lookup columns I need to specify them in the '$select'.

?$select=col1,col2,col3/Title,col4/Title.....,col54&$expand=col3,col4

Is there a way to access all columns from the lists without making multiple request to the server?

like image 866
Jijo Joy Avatar asked Mar 10 '23 15:03

Jijo Joy


1 Answers

you can try using * for all the columns.

In below example, * has been used to get all the columns. Country and State are lookup columns so they have been used along with * as they are part of $expand.

https://site/_api/lists/getbytitle('TestLookup')/items?$select=*,Country/Title,State/Title&$expand=Country/Id,State/Id
like image 157
Anit K Avatar answered May 01 '23 13:05

Anit K