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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With