0

I have a flow that is to send JSON items to an existing SharePoint List. I keep getting the error message:

The type SP.ListItemEntityCollection does not support HTTP PATCH method.

I've attached a copy of the current set-up. The name of the list I'm trying to add items to is named perdiem_rates. I've tried various versions of the Uri. I tried adding / and removing the /, tried with "web" and without "web".

Here are the main request parameters:

Method: POST

Uri: _api/web/lists/GetByTitle('perdiem_rates')/items/

Accept: application/json;odata=verbose 
Content-Type: application/json;odata=verbose
If-Match: *
X-HTTP-Method: MERGE


Body:

{
 "__metadata": {"type": "SP.Data.perdiem_ratesListItem"},
"Jan":@{items('Apply_to_each')['Jan']},
"Feb":@{items('Apply_to_each')['Feb']},
"Mar":@{items('Apply_to_each')['Mar']}
"Apr":@{items('Apply_to_each')['Apr']},
"May":@{items('Apply_to_each')['May']},
"Jun":@{items('Apply_to_each')['Jun']},
"Jul":@{items('Apply_to_each')['Jul']},
"Aug":@{items('Apply_to_each')['Aug']},
"Sep":@{items('Apply_to_each')['Sep']},
"Oct":@{items('Apply_to_each')['Oct']},
"Nov":@{items('Apply_to_each')['Nov']},
"Dec":@{items('Apply_to_each')['Dec']},
"Meals":@{items('Apply_to_each')['Meals']},
"County":@{items('Apply_to_each')['County']},
"City": @{items('Apply_to_each')['City']},
"State":@{items('Apply_to_each')['State']},
"DID":@{items('Apply_to_each')['DID']}
}
1
  • Have you tried removing the metadata property? Commented Sep 13 at 0:22

1 Answer 1

0

Can you remove the X-HTTP-Method key and MERGE value from the Headers? This suggests that you want to update an existing item. If I understand correctly you want to create a new list item?

Below is an example of the REST API documentation, if that helps?

https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-lists-and-list-items-with-rest#create-list-item

In case of an update you would also want to refer to the id of the item in your URI
POST https://{site_url}/_api/web/lists/GetByTitle('Test')/items({item_id})

https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-lists-and-list-items-with-rest#update-list-item

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.