Search code examples
sharepoint

Power Automate Error "Send an HTTP request SharePoint"


What am I missing?

  • SharePoint Site name: cBEYONDataManagers
  • List Name: Project Scorecard
  • Field trying to update the default value: ReportMonthYear
    • It's a date field

I'm getting an error

enter image description here

{
"statusCode": 400,
"headers": {
    "Cache-Control": "no-store, no-cache",
    "Pragma": "no-cache",
    "Set-Cookie": "ARRAffinity=ddcb58f4e7d4612fd9d0aff3394b5e86024fefcfe9489e80129e4b872a8b7da9;Path=/;HttpOnly;Secure;Domain=sharepointonline-cus.azconn-cus-002.p.azurewebsites.net,ARRAffinitySameSite=ddcb58f4e7d4612fd9d0aff3394b5e86024fefcfe9489e80129e4b872a8b7da9;Path=/;HttpOnly;SameSite=None;Secure;Domain=sharepointonline-cus.azconn-cus-002.p.azurewebsites.net",
    "x-ms-request-id": "5ea8d3a0-908c-3000-fd7e-e2b35a59d695",
    "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
    "X-Content-Type-Options": "nosniff",
    "X-Frame-Options": "DENY",
    "Timing-Allow-Origin": "*",
    "x-ms-apihub-cached-response": "true",
    "x-ms-apihub-obo": "false",
    "Date": "Thu, 24 Aug 2023 16:20:39 GMT",
    "Content-Length": "472",
    "Content-Type": "application/json",
    "Expires": "-1"
},
"body": {
    "status": 400,
    "message": "The parameter __metadata does not exist in method GetByTitle.\r\nclientRequestId: d4bf88c8-24b4-4631-9b13-6a58e99eb8d4\r\nserviceRequestId: 5ea8d3a0-908c-3000-fd7e-e2b35a59d695",
    "source": "https://cbeyondata.sharepoint.com/sites/cBEYONDataManagers/_api/web/lists/GetByTitle('Project%20Scorecards')/Fields/getbytitle('ReportMonthYear')",
    "errors": [
        "-1",
        "Microsoft.SharePoint.Client.InvalidClientQueryException"
    ]
}

}


Solution

  • Do you want to update the information of the date column of the item?

    Here, it is recommended to obtain the item ID through get items traversal, and then update the information of the date column through the method below Here is list: enter image description here

    You can get metadata by this way [get metadata1

    get metadata

    Get item id Get item id

    _api/web/lists/getbytitle('test111')/items(@{items('Apply_to_each')?['ID']})
    
    
    
    
     {
          "__metadata": {
            "type": "SP.Data.TestListItem"
          },
         "Title": "New title",
         "YOUR datetime name": "2020-11-24T18:39:05Z"
        }
    

    post datetime

    Here is test result: enter image description here