You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sp-add-ins/working-with-lists-and-list-items-with-rest.md
+259Lines changed: 259 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -228,6 +228,265 @@ The following XML shows an example of the list item properties that are returned
228
228
</content>
229
229
```
230
230
231
+
### Retrieve items as a stream
232
+
233
+
Retrieves information about the list and its data. Using this API you can retrieve list items in case they use complex fields such as lookups or managed metadata.
234
+
235
+
```text
236
+
POST /_api/web/GetList(@listUrl)/RenderListDataAsStream?@listUrl=%27%2Fsites%2Fteam-a%2Flists%2FList%27
237
+
```
238
+
239
+
#### URI Parameters
240
+
241
+
Following properties can be added as query string parameters to manipulate the returned data.
242
+
243
+
Property|Description|Type|Example
244
+
--------|-----------|----|-------
245
+
`CascDelWarnMessage`|Specifies if a message should be displayed if there is a cascade deletion warning|number|`1`
246
+
`DrillDown`|Specifies that some groups in a grouped view is expanded. Used with `GroupString`.|string|
247
+
`GroupString`|Group identifier used for drill down feature.|string|
248
+
`HasOverrideSelectCommand`|Used to ensure that certain fields are present for proper functioning of the SharePoint ListView control.|string|
249
+
`Field`|Specifies a special field that should be included.|string|
250
+
`FieldInternalName`|Used to identify a field when a list has an external data source. Also used when filtering on a custom field.|string|
251
+
`Filter`|Specifies whether the requested view should have a filter applied.|string|
252
+
`FilterData`|Data specified by a particular filter.|string|
253
+
`FilterData1`|Data specified by a particular filter.|string|
254
+
`FilterData2`|Data specified by a particular filter.|string|
255
+
`FilterData3`|Data specified by a particular filter.|string|
256
+
`FilterData4`|Data specified by a particular filter.|string|
257
+
`FilterData5`|Data specified by a particular filter.|string|
258
+
`FilterData6`|Data specified by a particular filter.|string|
259
+
`FilterData7`|Data specified by a particular filter.|string|
260
+
`FilterData8`|Data specified by a particular filter.|string|
261
+
`FilterData9`|Data specified by a particular filter.|string|
262
+
`FilterData10`|Data specified by a particular filter.|string|
263
+
`FilterField`|A filter field name for a specific filter that is applied to the view.|string|
264
+
`FilterField1`|A filter field name for a specific filter that is applied to the view.|string|`ID`
265
+
`FilterField2`|A filter field name for a specific filter that is applied to the view.|string|`ID`
266
+
`FilterField3`|A filter field name for a specific filter that is applied to the view.|string|`ID`
267
+
`FilterField4`|A filter field name for a specific filter that is applied to the view.|string|`ID`
268
+
`FilterField5`|A filter field name for a specific filter that is applied to the view.|string|`ID`
269
+
`FilterField6`|A filter field name for a specific filter that is applied to the view.|string|`ID`
270
+
`FilterField7`|A filter field name for a specific filter that is applied to the view.|string|`ID`
271
+
`FilterField8`|A filter field name for a specific filter that is applied to the view.|string|`ID`
272
+
`FilterField9`|A filter field name for a specific filter that is applied to the view.|string|`ID`
273
+
`FilterField10`|A filter field name for a specific filter that is applied to the view.|string|`ID`
274
+
`FilterFields`|Specifies multiple fields that are being filtered on for a multiplier filter.|string|
275
+
`FilterFields1`|Specifies multiple fields that are being filtered on for a multiplier filter.|string|
276
+
`FilterFields2`|Specifies multiple fields that are being filtered on for a multiplier filter.|string|
277
+
`FilterFields3`|Specifies multiple fields that are being filtered on for a multiplier filter.|string|
278
+
`FilterFields4`|Specifies multiple fields that are being filtered on for a multiplier filter.|string|
279
+
`FilterFields5`|Specifies multiple fields that are being filtered on for a multiplier filter.|string|
280
+
`FilterFields6`|Specifies multiple fields that are being filtered on for a multiplier filter.|string|
281
+
`FilterFields7`|Specifies multiple fields that are being filtered on for a multiplier filter.|string|
282
+
`FilterFields8`|Specifies multiple fields that are being filtered on for a multiplier filter.|string|
283
+
`FilterFields9`|Specifies multiple fields that are being filtered on for a multiplier filter.|string|
284
+
`FilterFields10`|Specifies multiple fields that are being filtered on for a multiplier filter.|string|
285
+
`FilterValue`|The filter value associated with a particular filter. For example, FilterField3 goes with FilterValue3 and so forth.|string|
286
+
`FilterValue1`|The filter value associated with a particular filter. For example, FilterField3 goes with FilterValue3 and so forth.|string|`1`
287
+
`FilterValue2`|The filter value associated with a particular filter. For example, FilterField3 goes with FilterValue3 and so forth.|string|`1`
288
+
`FilterValue3`|The filter value associated with a particular filter. For example, FilterField3 goes with FilterValue3 and so forth.|string|`1`
289
+
`FilterValue4`|The filter value associated with a particular filter. For example, FilterField3 goes with FilterValue3 and so forth.|string|`1`
290
+
`FilterValue5`|The filter value associated with a particular filter. For example, FilterField3 goes with FilterValue3 and so forth.|string|`1`
291
+
`FilterValue6`|The filter value associated with a particular filter. For example, FilterField3 goes with FilterValue3 and so forth.|string|`1`
292
+
`FilterValue7`|The filter value associated with a particular filter. For example, FilterField3 goes with FilterValue3 and so forth.|string|`1`
293
+
`FilterValue8`|The filter value associated with a particular filter. For example, FilterField3 goes with FilterValue3 and so forth.|string|`1`
294
+
`FilterValue9`|The filter value associated with a particular filter. For example, FilterField3 goes with FilterValue3 and so forth.|string|`1`
295
+
`FilterValue10`|The filter value associated with a particular filter. For example, FilterField3 goes with FilterValue3 and so forth.|string|`1`
296
+
`FilterValues`|Used with FilterFields for multiplier filter. For example, FilterFields3 would go with FilterValues3 and so forth.|string|
297
+
`FilterValues1`|Used with FilterFields for multiplier filter. For example, FilterFields3 would go with FilterValues3 and so forth.|string|
298
+
`FilterValues2`|Used with FilterFields for multiplier filter. For example, FilterFields3 would go with FilterValues3 and so forth.|string|
299
+
`FilterValues3`|Used with FilterFields for multiplier filter. For example, FilterFields3 would go with FilterValues3 and so forth.|string|
300
+
`FilterValues4`|Used with FilterFields for multiplier filter. For example, FilterFields3 would go with FilterValues3 and so forth.|string|
301
+
`FilterValues5`|Used with FilterFields for multiplier filter. For example, FilterFields3 would go with FilterValues3 and so forth.|string|
302
+
`FilterValues6`|Used with FilterFields for multiplier filter. For example, FilterFields3 would go with FilterValues3 and so forth.|string|
303
+
`FilterValues7`|Used with FilterFields for multiplier filter. For example, FilterFields3 would go with FilterValues3 and so forth.|string|
304
+
`FilterValues8`|Used with FilterFields for multiplier filter. For example, FilterFields3 would go with FilterValues3 and so forth.|string|
305
+
`FilterValues9`|Used with FilterFields for multiplier filter. For example, FilterFields3 would go with FilterValues3 and so forth.|string|
306
+
`FilterValues10`|Used with FilterFields for multiplier filter. For example, FilterFields3 would go with FilterValues3 and so forth.|string|
307
+
`FilterLookupId`|Used when filtering on a lookup field. This is the item id in the foreign list that has a value that is being filtered on.|string|
308
+
`FilterLookupId1`|Used when filtering on a lookup field. This is the item id in the foreign list that has a value that is being filtered on.|string|
309
+
`FilterLookupId2`|Used when filtering on a lookup field. This is the item id in the foreign list that has a value that is being filtered on.|string|
310
+
`FilterLookupId3`|Used when filtering on a lookup field. This is the item id in the foreign list that has a value that is being filtered on.|string|
311
+
`FilterLookupId4`|Used when filtering on a lookup field. This is the item id in the foreign list that has a value that is being filtered on.|string|
312
+
`FilterLookupId5`|Used when filtering on a lookup field. This is the item id in the foreign list that has a value that is being filtered on.|string|
313
+
`FilterLookupId6`|Used when filtering on a lookup field. This is the item id in the foreign list that has a value that is being filtered on.|string|
314
+
`FilterLookupId7`|Used when filtering on a lookup field. This is the item id in the foreign list that has a value that is being filtered on.|string|
315
+
`FilterLookupId8`|Used when filtering on a lookup field. This is the item id in the foreign list that has a value that is being filtered on.|string|
316
+
`FilterLookupId9`|Used when filtering on a lookup field. This is the item id in the foreign list that has a value that is being filtered on.|string|
317
+
`FilterLookupId10`|Used when filtering on a lookup field. This is the item id in the foreign list that has a value that is being filtered on.|string|
318
+
`FilterOnly`||string
319
+
`FilterOp`|Filter operator. Used when filtering with other operators than Eq (Geq, Leq etc.)|string|`Geq`
320
+
`FilterOp1`|Filter operator. Used when filtering with other operators than Eq (Geq, Leq etc.)|string|`Geq`
321
+
`FilterOp2`|Filter operator. Used when filtering with other operators than Eq (Geq, Leq etc.)|string|`Geq`
322
+
`FilterOp3`|Filter operator. Used when filtering with other operators than Eq (Geq, Leq etc.)|string|`Geq`
323
+
`FilterOp4`|Filter operator. Used when filtering with other operators than Eq (Geq, Leq etc.)|string|`Geq`
324
+
`FilterOp5`|Filter operator. Used when filtering with other operators than Eq (Geq, Leq etc.)|string|`Geq`
325
+
`FilterOp6`|Filter operator. Used when filtering with other operators than Eq (Geq, Leq etc.)|string|`Geq`
326
+
`FilterOp7`|Filter operator. Used when filtering with other operators than Eq (Geq, Leq etc.)|string|`Geq`
327
+
`FilterOp8`|Filter operator. Used when filtering with other operators than Eq (Geq, Leq etc.)|string|`Geq`
328
+
`FilterOp9`|Filter operator. Used when filtering with other operators than Eq (Geq, Leq etc.)|string|`Geq`
329
+
`FilterOp10`|Filter operator. Used when filtering with other operators than Eq (Geq, Leq etc.)|string|`Geq`
330
+
`ID`|The item id of the item whose information is being sought.|number|
331
+
`InplaceSearchQuery`|Search term for a full list search.|string|
332
+
`InplaceFullListSearch`|A boolean that specifies whether there is a full list search.|string|
333
+
`IsCSR`|Whether this view is a client side rendered view.|string|
334
+
`CustomAction`||string|
335
+
`IsGroupRender`|Used to set the IsGroupRender property of the SPView.|string|
336
+
`IsRibbon`||string|
337
+
`IsXslView`|Whether this view is an xslt list view.|string|
338
+
`List`||string|
339
+
`ListId`||string|
340
+
`ListViewPageUrl`||string|
341
+
`OverrideScope`|Used to override a scope on the rendered view: SPView.Scope|string|
342
+
`OverrideSelectCommand`|Used to make sure that certain fields are present in the query regardless of whether they are explicitly included in the view.|string|
343
+
`PageFirstRow`|Paging information about the first row that is requested. Used for paging list views.|string|
344
+
`PageLastRow`|Paging information about the last row that is requested. Used for paging list views.|string|
345
+
`RootFolder`|The folder that the view is displaying.|string|
346
+
`SortField`|A field that the view should be sorted on.|string|`ID`
347
+
`SortField1`|A field that the view should be sorted on.|string|`ID`
348
+
`SortField2`|A field that the view should be sorted on.|string|`ID`
349
+
`SortField3`|A field that the view should be sorted on.|string|`ID`
350
+
`SortField4`|A field that the view should be sorted on.|string|`ID`
351
+
`SortField5`|A field that the view should be sorted on.|string|`ID`
352
+
`SortField6`|A field that the view should be sorted on.|string|`ID`
353
+
`SortField7`|A field that the view should be sorted on.|string|`ID`
354
+
`SortField8`|A field that the view should be sorted on.|string|`ID`
355
+
`SortField9`|A field that the view should be sorted on.|string|`ID`
356
+
`SortField10`|A field that the view should be sorted on.|string|`ID`
357
+
`SortFields`|Specifies the name of the first field to sort by|string|
358
+
`SortFieldValues`|Specifies the name of the first field to sort by|string|
359
+
`SortDir`|The sort direction of an ad hoc sort that is being applied to the view.|string|`Desc`
360
+
`SortDir1`|The sort direction of an ad hoc sort that is being applied to the view.|string|`Desc`
361
+
`SortDir2`|The sort direction of an ad hoc sort that is being applied to the view.|string|`Desc`
362
+
`SortDir3`|The sort direction of an ad hoc sort that is being applied to the view.|string|`Desc`
363
+
`SortDir4`|The sort direction of an ad hoc sort that is being applied to the view.|string|`Desc`
364
+
`SortDir5`|The sort direction of an ad hoc sort that is being applied to the view.|string|`Desc`
365
+
`SortDir6`|The sort direction of an ad hoc sort that is being applied to the view.|string|`Desc`
366
+
`SortDir7`|The sort direction of an ad hoc sort that is being applied to the view.|string|`Desc`
367
+
`SortDir8`|The sort direction of an ad hoc sort that is being applied to the view.|string|`Desc`
368
+
`SortDir9`|The sort direction of an ad hoc sort that is being applied to the view.|string|`Desc`
369
+
`SortDir10`|The sort direction of an ad hoc sort that is being applied to the view.|string|`Desc`
370
+
`View`|Specifies the base view that will be used to render the list.|GUID|`3d13559e-3071-5000-76b8-8f1ca6b835f0`
371
+
`ViewPath`|Specifies the path of the view that will be used to render the list. If `ViewId` is given then the `ViewId` will be used and this parameters will be ignored.|string|
372
+
`ViewCount`|When multiple list views are on a page, this identifies one of them.|string|
373
+
`ViewId`|Specifies the base view that will be used to render the list. ad-hoc parameters will be applied on top of this view. If both `ViewXml` and `BaseViewId` are given then the `ViewXml` will be used and the ad-hoc parameters will be ignored.|string|
374
+
`WebPartId`|The id of the list view web part that is showing this view.|string|
375
+
376
+
#### Request headers
377
+
378
+
Header|Value
379
+
-------|-----
380
+
Accept|application/json;odata=nometadata
381
+
Content-Type|application/json;odata=nometadata
382
+
383
+
#### Request body
384
+
385
+
```json
386
+
{
387
+
"parameters": {
388
+
"AddRequiredFields": "true",
389
+
"DatesInUtc": "true",
390
+
"RenderOptions": 17
391
+
}
392
+
}
393
+
```
394
+
395
+
Property|Description|Type|Example
396
+
--------|-----------|----|-------
397
+
`AddRequiredFields`|Specifies if required fields should be returned or not|bool|`true`
398
+
`AllowMultipleValueFilterForTaxonomyFields`|Specifies if multi value filtering is allowed for taxonomy fields or not|bool|`true`
399
+
`DatesInUtc`|Specifies if we return DateTime field in UTC or local time.|bool|`true`
400
+
`ExpandGroups`|Specifies if the grouping should be expanded or not.|bool|`true`
401
+
`FirstGroupOnly`|Specifies if only the first group should be returned or not (regardless of view schema).|bool|`true`
402
+
`FolderServerRelativeUrl`|Specifies the url to the folder from which to return items.|string|`/sites/team-a/lists/Orders/Europe`
403
+
`ImageFieldsToTryRewriteToCdnUrls`|Comma-separated list of field names whose values should be rewritten to CDN URLs|string|`ArticleImage,SecondaryImage`
404
+
`OverrideViewXml`|Specifies the override XML to be combined with the View CAML. Applies only to the `Query/Where` part of the View CAML.|string|`<Query><Where><Gt><FieldRef Name=\"OrderCount\" /><Value Type=\"Number\">3</Value></Gt></Where></Query>`
405
+
`Paging`|Specifies the paging information.|string|
406
+
`RenderOptions`|Specifies the type of output to return.|SPRenderListDataOptions|See the next section for possible values. You can specify multiple values by adding their values together
407
+
`ReplaceGroup`|Specifies if the grouping should be replaced or not to deal with GroupBy throttling.|bool|`true`
408
+
`ViewXml`|Specifies the CAML view XML.|string|
409
+
410
+
##### SPRenderListDataOptions
411
+
412
+
Label|Description|Value
413
+
-----|-----------|-----
414
+
`None`|Return default output|`0`
415
+
`ContextInfo`|Return list context information|`1`
416
+
`ListData`|Return list data (same as `None`)|`2`
417
+
`ListSchema`|Return list schema|`4`
418
+
`MenuView`|Return HTML for the list menu|`8`
419
+
`ListContentType`|Returns information about list content types. Must be combined with the `ContextInfo` flag|`16`
420
+
`FileSystemItemId`|The returned list will have a FileSystemItemId field on each item if possible. Must be combined with the `ListData` flag|`32`
421
+
`ClientFormSchema`|Returns the client form schema to add and edit items.|`64`
`PageContextInfo`|Returns page context info for the current list being rendered.|`16384`
430
+
`ClientSideComponentManifest`|Return client-side component manifest information associated with the list. Reserved for future use|`32768`
431
+
432
+
#### Examples
433
+
434
+
Retrieve item with specific ID
435
+
436
+
```text
437
+
POST https://contoso.sharepoint.com/sites/team-a/_api/web/GetList(@listUrl)/RenderListDataAsStream?@listUrl=%27%2Fsites%2Fteam-a%2Flists%2FList%27&FilterField1=ID&FilterValue1=1
438
+
accept: application/json;odata=nometadata
439
+
```
440
+
441
+
Sort items descending by ID
442
+
443
+
```text
444
+
POST https://contoso.sharepoint.com/sites/team-a/_api/web/GetList(@listUrl)/RenderListDataAsStream?@listUrl=%27%2Fsites%2Fteam-a%2Flists%2FList%27&SortField=ID&SortDir=Desc
445
+
accept: application/json;odata=nometadata
446
+
```
447
+
448
+
Retrieve items from the specified folder
449
+
450
+
```text
451
+
POST https://contoso.sharepoint.com/sites/team-a/_api/web/GetList(@listUrl)/RenderListDataAsStream?@listUrl=%27%2Fsites%2Fteam-a%2Flists%2FOrders%27
0 commit comments