Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Triggers
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Resources
  • Get help with flow
Menu

List schema for HTTP request to create item in Power Automate

Posted on January 4, 2023January 11, 2023 by Tom

“I’m trying to create a SharePoint item in a dynamic list with Power Automate, but the HTTP request always returns an error message.”

“A type named ‘SP.Data.xxxListItem’ could not be resolved by the model. When a model is available, each type name must resolve to a valid type.”


If you use Power Automate to create SharePoint items in various SP sites or lists, e.g. using some configuration list, you probably use an HTTP request. You don’t have to know the site url or the list name in advance, it can be different for each flow run, but it has also a downside. While the ‘Create item’ action makes things very easy as it’s just a bunch of dropdowns and input fields, the HTTP request is a bit more complex. Not only you must define all the fields manually, you must provide also the list schema information. And this post will tell you how.

Where to get SP.Data.<THIS PART>ListItem

As explained in the linked article, before you define the columns, you must define what columns can the item have. That’s done in the “type” part.

{
  "__metadata": {
    "type": "SP.Data.<ListName>ListItem"
  },
  "Column1": "Value1",
  "Column2": "Value2",
  "Column3": "Value3"
}

If you use single words without special characters for the list name, you can just use the name. But if you use more complex names, you’ll have to do some extra work.

The reason is that this name can’t contain any special characters nor spaces (it’s similar as column internal names). But unlike the column names, you can’t take it from the list settings. Yet there’s an HTTP request to use!

Get it manually using a browser

If the list name is always the same, you can take it manually. Just open a new tab in your browser and build an url from the HTTP request.

Power Automate create item list HTTP

Replace the placeholders so it’ll have the format as the example below.

https://xxx.sharepoint.com/sites/playground/_api/web/lists/GetByTitle('Cloud%20Funding%20Staging')

Use it as the address and press Enter. You’ll get an output with all the information about the list.

Power Automate create item list HTTP

Search for the ‘ListItemEntityTypeFullName’, that’s the whole “type” to use in the HTTP request.

Get it with an HTTP request

If it’s not the same, but can have a different value for each list, you can add another HTTP request to get it in your flow.

Method: 
GET

Uri:
_api/web/lists/GetByTitle('<ListName>')

The expression below will then give you the list entity name…

body('Send_an_HTTP_request_to_SharePoint_2')?['d']?['ListItemEntityTypeFullName']

… that you can use in the HTTP request to create the item.

Power Automate create item list HTTP

Summary

If you use complicated list names (anything with spaces or special characters), you’ll almost always have to do a bit more work. The HTTP request to create list item needs the “type” of the “item to be created” which can be a bit different from the list name, but that’s not a blocker. If the list is always the same you can take it only once via browser and save some API calls, or you can use another HTTP request. Once you have the right “type” you can create the item.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Do you know what to do, but not how to do it?

Get The Ultimate Power Automate expressions cheat sheet and translate your thoughts into flows with ease!


NEW! Master the HTTP requests to SharePoint with a new cheat sheet!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Hello and welcome!

My name is Tom and I'm a business process automation consultant and Microsoft MVP living in the Czech Republic. I’ve been working with Microsoft technologies for almost 10 years, currently using mainly Power Automate, SharePoint, Teams, and the other M365 tools.

I believe that everyone can automate part of their work with the Power Automate platform. You can achieve a lot by "clicking" the flows in the designer, but you can achieve much more if you add a bit of coding knowledge. And that's what this blog is about.

To make the step from no-code Power Automate flows to low-code flows: using basic coding knowledge to build more complex yet more efficient flows to automate more of your daily tasks.

  • Use Power Automate to forward Outlook events upon registrationJanuary 29, 2023
  • Why the condition is false for the same numbers (Power Automate)January 25, 2023
  • How to forward event invitation to other calendar (Power Automate)January 22, 2023
  • Run ‘For selected item’ flow from non-default environment (Power Automate)January 18, 2023
  • Hide button in SharePoint list after Power Automate flow startedJanuary 15, 2023

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes