Using the beta SharePoint REST API (using Microsoft Graph ). Would like to get all items for a list, including the content of custom fields.
When I use https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}?expand=columns,items(expand=fields)
I see (in my case):
columns
containing 32 fields, including standard ones (eg ID
, Title
, Status
) and the custom ones (eg Next_action
) fields
containing only the default (in my case 23) fields, including id
[note it is lower case], Title
and Status
fields and -as expected- not the custom ones. The documentation shows an example of getting specific columns . When I use https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}/items?expand=fields(select=ID,Title,Status,Next_action)
Then I get an array with all items, and per item the object fields
that only contains the property id
.
So: the other standard fields ( Title
, Status
) and the custom field Next_action
do not show up.
How do I get the values for a list of standard and custom fields?
A couple of the lists are default ones that have been customized (I believe Tasks, Issues, Risks), others are completely custom (Decisions, Changes). The Tasks lists has versioning.
Some observations:
columns
and the actual fields
) Possibly related, when using Flow I create a trigger for "when an item is created or modified", I am then presented with only 2 lists (Changes and Decisions). Missing: Tasks, Risks, Issues.
Tasks
Risks
Issues
Decisions
Changes
There seems to be a bug in the current /beta
endpoint around $expand={field}($select={field})
. I'm seeing similar results.
I am however seeing the complete list of fields when I use:
/beta/sites/{site-id}/lists/{list-id}/items?$expand=fields
I'm also able to return the complete set of columns, items and fields using:
/beta/sites/{site-id}/lists/{list-id}$expand=columns,items($expand=fields)
For the time being, you'll need to pull the entire collection and handle any additional processing in your app. Being a beta release there are several bugs still being worked out. This is why it isn't recommended that this be used for production.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.