Get the SP.Data Item Type for use in a SharePoint REST Update
When using the Send an HTTP request to SharePoint action in Power Automate to update a SharePoint list item, we need to include the __metadata
attribute in the body of our request. However, the name of this "type" varies based on the list or library. In general, it's SP.Data.{YourListName}ListItem
for a List and SP.Data.{YourLibraryName}Item
for a library, but it can vary depending on spaces, special characters, or other factors.
What you will need
- The URL to your SharePoint site.
- The name of the SharePoint list or library you're saving to.
Call the API through your address bar
- Browse to your SharePoint site.
- Append the URL shown below to your SharePoint site URL after updating {MyListName} to the name of your SharePoint list.
/_api/web/lists/getbytitle('{MyListName')?$select=ListItemEntityTypeFullName
- Hit enter to run it.
- For my example, my list name is "Active Approvals".
https://contoso.sharepoint.com/sites/contosohome/_api/web/lists/getbytitle('Active%20Approvals')?$select=ListItemEntityTypeFullName
- It will return a response, from which you can find the ListItemEntityTypeFullName value. In my example, it is
SP.Data.Active_x0020_ApprovalsListItem
. Notice that the space in my list name is converted tox0020
.
Add the type to your Request Body
- In your Send an HTTP request to SharePoint action, you will use the value you retrieved above, as shown below.
{
"__metadata": {
"type": "SP.Data.Active_x0020_ApprovalsListItem"
},
"Field1": "Value",
"Field2": "Value"
}
In this example, the SP.Data.Active_x0020_ApprovalsListItem is the correct type for our list named Active Approvals.
Member discussion