web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Invalid JSON. A comma ...
Power Automate
Suggested Answer

Invalid JSON. A comma character ',' was expected in scope 'Object'

(1) ShareShare
ReportReport
Posted on by 207
Hi Experts,
 
I am trying to rename a file in the sharepoint folder post extraction actions.
Below the flow which is using for this task:
 
 
File location :
 
 
I am trying to renaming the above file into "Risk Findings.xlsx" , after the flow runs it got the below error message and failed.
 
{
  "status"400,
  "message""Invalid JSON. A comma character ',' was expected in scope 'Object'. Every two elements in an array and properties of an object must be separated by commas.\r\nclientRequestId: 4180f1cc-0d73-44ce-ba39-66427c218398\r\nserviceRequestId: 2acc57a1-a00f-a000-0590-e99dc93dca30",
  "source""https://xxxxx.sharepoint.com/sites/yyyy122/_api/lists/GetByTitle('Documents')/Items(61)",
  "errors": [
    "-1",
    "Microsoft.SharePoint.Client.InvalidClientQueryException"
  ]}
 
Please help to solve this ..
 
Thanks
DK
 
Categories:
I have the same question (0)
  • Suggested answer
    abc 123 Profile Picture
    789 Moderator on at
    I'm guessing that the greater than and less than symbols are invalid, but maybe you just altered that to hide personal data.
     
    Check this out:
  • Suggested answer
    Expiscornovus Profile Picture
    33,773 Most Valuable Professional on at
    I see you used the Body of the first HTTP request in the type field value of the second request. It probably is confused about that because the first request returns all properties of a list item instead of just a single property value of the library/list itself.

    If you want to get the type value of your list/library you can use the ListItemEntityTypeFullName. I have also shared a blog about how to retrieve this type value:
     
    I would suggest to change the URI of the Send an HTTP request to SharePoint to get type action to be below:
    _api/web/lists/GetByTitle('Documents')/?$select=ListItemEntityTypeFullName
     
    In the Send an HTTP request to SharePoint to rename file action use the below json in the body field instead:
    {"__metadata":
    {"type":"@{outputs('Send_an_HTTP_request_to_SharePoint_to_get_type')?['body']?['d']?['ListItemEntityTypeFullName']}"},
    "FileLeafRef":"Risk Findings.xlsx"}
     
     
  • Suggested answer
    DineshK_ Profile Picture
    207 on at
     
    I have used the below body content and after that old error is gone and getting new error as below :
     
     
    File is not opened anywhere , the flow will generate this file (so every run the file will be NEW only) and then renaming it by using HTTP action . You can see full flow in the post.
    How to overcome this error ?
     
    {'__metadata':
    {'type':'SP.Data.Shared_x0020_DocumentsItem'},
    'FileLeafRef':'<New filename>'
    }
     
     
  • Expiscornovus Profile Picture
    33,773 Most Valuable Professional on at
    That is because earlier in the flow you were still interacting with the Excel file via the add a new row action, which will lock it/consider the file still in use.
     
    You can handle this behaviour in several ways. In your case why don't you rename the file before you are adding the rows to the table? Or do you have a specific reason to rename it at the end?
     
    Alternatively, have a look at this article from Matthew Devaney with 4 other approaches:
  • Suggested answer
    DineshK_ Profile Picture
    207 on at
    This flow will run every week to generate this file , so to avoid duplications i have added utcnow in the file name.
    Now i sorted this issue by adding delay action before the rename .
    works well :) Thanks you ..

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 251 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 239

#3
Expiscornovus Profile Picture

Expiscornovus 220 Most Valuable Professional

Last 30 days Overall leaderboard