Sharepoint REST API: How to retrieve all columns of all records via RenderListDataAsStream api

%3CLINGO-SUB%20id%3D%22lingo-sub-1145096%22%20slang%3D%22en-US%22%3ESharepoint%20REST%20API%3A%20How%20to%20retrieve%20all%20columns%20of%20all%20records%20via%20RenderListDataAsStream%20api%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1145096%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20sharepoint%20online%20list%20with%2014k%2B%20rows%20and%20250%2Bcolumns%2C%2035%2B%20of%20them%20being%20lookups.%20We%20have%20reached%20the%20maximum%20number%20of%20fields%20that%20can%20be%20indexed.%3C%2FP%3E%3CP%3EIt's%20a%20legacy%20list%20and%20it's%20used%20a%20source%20of%20data%20entry%2C%20not%20for%20documents%2Ffiles.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20retrieve%20via%20REST%20api%20all%20the%20rows%20(and%20all%20its%20columns)%2C%20however%2C%20I%20am%20facing%20an%20issue%20while%20doing%20so.%20Here%20is%20all%20that%20I've%20tried%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20used%20the%20Items%20endpoint%2C%20I%20get%20all%20columns%20but%20the%20lookup%20fields%20contain%20Id%20and%20not%20the%20actual%20LookUp%20value%20itself.%20I%20cannot%20use%20%24expand%20because%20it%20crosses%20the%20threshold%20limit%20for%20number%20of%20lookups%20being%20expanded%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20used%20the%20RenderListDataAsStream%20api%2C%20and%20configured%20the%20body%20of%20the%20request%20with%20a%20ViewXML%20property%20to%20define%20the%20CAML%20query%20and%20omitted%20the%20%22ViewFields%22%20defintion%20while%20specifying%20pagination%20and%20RowLimit.%20This%20works%20like%20a%20charm%20except%20not%20all%20fields%20are%20returned%2C%20some%20lookup%20fields%20are%20left%20out.%20It%20also%20leaves%20out%20some%20of%20the%20Indexed%20lookup%20fields.%20I%20cannot%20specify%20all%20the%20columns%20in%20%22ViewFIelds%22%20because%20then%20it%20throws%20a%20threshold%20limit%20error%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%20using%20Items%2F(ITEM_ID)%2FFieldValuesAsText%20and%20this%20works%20fine%20except%20the%20date%20fields%20have%20values%20that%20are%20not%20what%20we%20want%2Fexpect.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20then%20tried%20using%20Items%2F(ITEM_ID)%2FVersions%3F%24top%3D1%20(AND)%20Items%2F(ITEM_ID)%2FVersions%3F%24filter%3DIsCurrentVersion%20eq%20true%20and%20this%20seems%20to%20solve%20the%20problem%20but%20again%2C%20some%20date%20field%20values%20are%20confusing%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMost%20of%20the%20date%20fields%20are%20stored%20as%20DateOnly%20but%20when%20we%20retrieve%20via%20normal%20Items%20they%20return%20in%20UTC%20format%20which%20is%20fine.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20someone%20help%2Fpoint%20me%20in%20the%20right%20direction%20please%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1145096%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ERenderListDataAsStream%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EREST%20API%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Frequent Visitor

Hello,

 

I have a sharepoint online list with 14k+ rows and 250+columns, 35+ of them being lookups. We have reached the maximum number of fields that can be indexed.

It's a legacy list and it's used a source of data entry, not for documents/files.

 

I am trying to retrieve via REST api all the rows (and all its columns), however, I am facing an issue while doing so. Here is all that I've tried:

 

I used the Items endpoint, I get all columns but the lookup fields contain Id and not the actual LookUp value itself. I cannot use $expand because it crosses the threshold limit for number of lookups being expanded

 

I used the RenderListDataAsStream api, and configured the body of the request with a ViewXML property to define the CAML query and omitted the "ViewFields" defintion while specifying pagination and RowLimit. This works like a charm except not all fields are returned, some lookup fields are left out. It also leaves out some of the Indexed lookup fields. I cannot specify all the columns in "ViewFIelds" because then it throws a threshold limit error

 

I tried using Items/(ITEM_ID)/FieldValuesAsText and this works fine except the date fields have values that are not what we want/expect.

 

I then tried using Items/(ITEM_ID)/Versions?$top=1 (AND) Items/(ITEM_ID)/Versions?$filter=IsCurrentVersion eq true and this seems to solve the problem but again, some date field values are confusing

 

Most of the date fields are stored as DateOnly but when we retrieve via normal Items they return in UTC format which is fine.

 

Can someone help/point me in the right direction please?

 

Thanks

 

 

 

0 Replies