- Before you get started
- Getting items or files
- Returning only specific columns
- Filtering the items or files
- Returning more data
- Ordering the results
- Creating or updating items or files
- Before you start
- Get the ListItemEntityTypeFullName
- Create list items
- Information regarding PersonFields and ManagedMetadataMultiple
- Update list items or file properties
- Option 1: Update list or file properties with create schema
- Option 2: Update list or file properties (recommended)
- Notes about claim based person and group columns
- Deleting files or items
- Delete file or item without it going to the recycle bin
- Copying files and pages
- Checking copy job progress
- Moving files or folders by path
- Checkout site page
- Check in/out document
- Changelog
Before you get started
- Just like the filter queries in built-in actions, you will always have to use a columns internal names to create, select, filter or update its values
- Responses directly from the REST API look different from the built-in connector responses. You will need to parse the responses from that action either by parsing manually or with a “Parse JSON” action. Take your time to understand the response schema.
- Read more about the REST API
//object outputs (where the action only returns one thing)
body('YOURACTION')?['d']
//array outputs (where the action returns a list of results)
body('YOURACTION')?['d']?['results']Getting items or files
Method: GET
//This gets you all items
Uri: _api/web/lists('LIST GUID')/items
//returning a specific item by its ID
_api/web/lists('LIST GUID')/items(1)
Headers:
{
"Accept": "application/json; odata=verbose",
"Content-Type": "application/json; odata=verbose"
}Returning only specific columns
Filtering the items or files
Returning more data
Best approach for this is to use the ODATA next property. With that property you can use a do until loop to get all the data in the list, 5000 elements at a time.
//using top to return as much data as possible
_api/web/lists('LIST GUID')/items?$top=5000Advanced methods:
Ordering the results
Method: GET
URI:
//order by id, default ascending
_api/web/lists('LIST GUID')/items?$orderby=Id
//order by id, descending
_api/web/lists('LIST GUID')/items?$orderby=Id desc
//combining orderby with a filter
_api/web/lists('LIST GUID')/items?$filter=startswith(ContentTypeId,'0x0120')&$orderby=IdCreating or updating items or files
Before you start
Creating list items as well as one of the update methods require you to use the lists unique entity type. It includes the lists name.
Get the ListItemEntityTypeFullName
Many times, this specific name is used to update files or list items. Depending on the name of your list or library this name will change.
Create list items
Information regarding PersonFields and ManagedMetadataMultiple
For Person fields you will need the internal SharePoint User or group Id, this is not the Entra Id. SharePoint will also only give people or groups an Id, if they have been previously used in a person column. Otherwise, you will not get any id. A workaround can be a seperate hidden list, where you quickly add that person to a person column to get the id.
Creating (and updating) data in Managed Metadata columns that accept multiple values is an absolute nightmare to work with. SharePoint expects its internal name for your managed metadata column(s) and the values as a string. Which is not at all similar to the single choice managed metadata.
Update list items or file properties
There are two ways to update an item or a file.
Syntax from create list item | Syntax with ValidateUpdateListItem() | |
PRO | 1. Same syntax as the create list item request
2. DateTime columns have a reasonable format
3. Numbers and boolean values do not need “” to work | 1. Only uses the columns internal name (no looking up the “real” internal names for managed metadata)
2. Uses claim based values for Person and Group columns
3. lets you update without adding a new version (bNewDocumentUpdate = true) |
CONTRA | 1. Uses Ids for person and group columns
2. requires you to get “special internal names” for all 3. managed metadata columns that allow multiple values
4. requires the EntityTypeFullName | 1. Values for columns are more complicated to build
2. DateTime values are not norm
3. Just because it was successful doesn't mean everything was updated accordingly. (If the input is right, it will work well) |
Option 1: Update list or file properties with create schema
Option 2: Update list or file properties (recommended)
The boolean value for “bNewDocumentUpdate” creates a new item version, when false and doesn’t when set to true. If no new version is added, you wont see any changes when looking at the version history. Even though this parameter doesn’t create a new version, it will still trigger automated flows like “When an item is created or modified”.
Notes about claim based person and group columns
There is two major differences with claim based columns. For this you will need specific values to either update the column with:
- a Person
- a Microsoft 365 group (Teams or SharePoint)
- a Security group from Entra ID
i:0#.f|membership|user@domain.com
c:0o.c|federateddirectoryclaimprovider|GROUP-ID
c:0t.c|tenant|GROUP-ID
Deleting files or items
Method: DELETE
Uri: _api/web/lists('LIST GUID')/items(ID)
Headers:
{
"If-Match":"*"
}Delete file or item without it going to the recycle bin
The file or item wont show in the first or second stage recycle bin.
Method: DELETE
Uri: _api/web/lists('LIST GUID')/items(ID)
Headers:
{
"If-Match":"ETAG of the file or item"
}Copying files and pages
Moving files or pages isn’t always available with the UI. You can easily use this HTTP request with Power Automate to move or copy files from one site collection to another.
And the good part about this, is that is also works for site pages. Remove the // comments when pasting the code in your actions.
https://learn.microsoft.com/en-us/sharepoint/dev/apis/spod-copy-move-api
Checking copy job progress
In case you are copying folders or multiple files, you want to check the progress before continuing in your flow. The request to copy is basically fire and forget as long as there are not major request errors.
Method: POST
Uri: _api/site/GetCopyJobProgressMoving files or folders by path
Technically uses the copy job API in the backend. You can only copy or move one item with one request. The request above allows you to move multiple items to a single destination.
Checkout site page
This method only works for site pages and only when checking out.
Method: POST
Uri: _api/SitePages/Pages(PAGEID)/CheckoutPage
Headers:
{
"Accept": "application/json; odata=verbose",
"Content-Type": "application/json; odata=verbose"
}Check in/out document
Can also be done with built-in actions.
0 = Minor version
1 = Major version
2 = Overwrite file
Method: POST
Uri: _api/web/lists(guid'LISTGUID')/items(ITEMID)/CheckIn(comment='Comment',checkintype=0)
Headers:
{
"Accept": "application/json; odata=verbose",
"Content-Type": "application/json; odata=verbose"
}Method: POST
Uri: _api/web/lists(guid'LISTGUID')/items(ITEMID)/CheckOut
Headers:
{
"Accept": "application/json; odata=verbose",
"Content-Type": "application/json; odata=verbose"
}Changelog
Date | Changes |
16.12.2023 | Initial version |
Throughout 2024/2025 | Various changes and additions |
29.09.2025 | Changed the chapter for “Returning more data” to recommend odata next property |
27.02.2026 | Example output for the get items method
FileLeafRef and FileRef
OrderBy Examples |
25.03.26 | Removed RenderListDataAsStream
Added link to “Getting more items with Pagination and Top” |