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 / Update file metadata v...
Power Automate
Unanswered

Update file metadata via Rest api Sharepoint

(0) ShareShare
ReportReport
Posted on by 73

Hi,
I'm trying to update a files metadata by using the Sharepoint Rest API.

Now I'm getting this error: Input string was not in a correct format.

Are there examples how to do this? 
I'm struggeling with the Json body code I think.

First I get the file info by calling /_api/Web/Lists/getByTitle('Archived')/Items('31')

Then I parse the output to Json and create the variables (project, originator, volume, level, type,rol)
Then I post to the api endpoint.

rolanddaane_0-1636490267753.png

 

My Flow can be found here: https://app.box.com/s/dmw1ykn9j6h44uy89a7duxzrk9okp6m9 

Any help is much apreciated

Categories:
  • mahoneypat Profile Picture
    1,720 on at

    Have you already looked at the Peek Code for that step to see if something is off?  For example, is the / in front of the URI needed, or do you see two of them in Peek Code?  Or do you need to convert var_GUID to text?

     

    Pat

  • rolanddaane Profile Picture
    73 on at

    Hi,
    There seems to an issue with the input because I get the error "Input string was not in a correct format".
    I hardcoded the site address, and then the URI has to start with a "/".
    This is the input code from the call:

    {
        "host": {
            "connectionReferenceName": "shared_sharepointonline",
            "operationId": "HttpRequest"
        },
        "parameters": {
            "dataset": "https://bamgroup.sharepoint.com/sites/025556",
            "parameters/method": "POST",
            "parameters/uri": "/_api/Web/Lists/getByTitle('Archived')/Items('a7bda960-be35-45fa-bd0e-d9169749a715')",
            "parameters/headers": {
                "content-type": "application/json;odata=verbose",
                "accept": "application/json;odata=verbose",
                "X-HTTP-Method": "MERGE",
                "If-Match": "*"
            },
            "parameters/body": "{\n  \"__metadata\": {\n    \"type\": \"SP.Data.ArchivedListItem\"\n  },\n  \"Title\": \"NewTitle\"\n}"
        }
    }

     

    rolanddaane_0-1636653611088.png

     




  • rolanddaane Profile Picture
    73 on at

    Yeah I did, but I also parsed the output to Json, and viewed that output.

    In the xml scheme I saw that the column had a different name.....

    What do you mean with Peek Code?
    Thanks!

  • Schwerzmann Profile Picture
    40 on at

    Hi @rolanddaane 

    The seems to be a while ago, but might still be a topic?

    I had a similar situation while trying to update a file content type in SharePoint via RestAPI. I struggled over and over even I was seeing no error in my syntax at all. Finally, I was able to solve it by first composing a JSON with the following structure (this is valid for Content Type changes only):

    {
     "{ContentType}": {
     "@@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedContentType",
     "Id": "[0x010100_______]",
     "Name": "[DocumentContentTypeName]"
     }
    }

    The output of this step I loaded into my Body-Part of the "HTTP request to SharePoint"-step and it suddenly worked.

    So, you might try to load your body part into a "Compose JSON" step first and reuse that one instead.

    Good luck 😉

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 430

#2
11manish Profile Picture

11manish 341 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 282

Last 30 days Overall leaderboard