Share via

How to update Sharepoint list item hyperlink column

Macháček Martin 306 Reputation points
2021-11-30T08:03:33.697+00:00

I'm trying to update hyperlink column with the following request

PATCH https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}/fields

Content-Type application/json

Request body:

{
    "OriginalImageLink": {
        "url": "https://example.com/img1.jpg",
        "description": "Url link"
    }
}

But it returns invalid request error

{
    "error": {
        "code": "invalidRequest",
        "message": "Invalid request",
        "innerError": {
            "date": "2021-11-30T07:53:25",
            "request-id": "229c925b-db3a-4ce6-abee-78f4e626151c",
            "client-request-id": "43e37eac-75a8-40d3-3c96-b9cb3a0e0eba"
        }
    }
}

Does Graph API support updating of hyperlink column? How can I update hyperlink column using graph sdk for .net?

Microsoft 365 and Office | SharePoint | Development
Microsoft Security | Microsoft Graph
Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.


Answer accepted by question author

CarlZhao-MSFT 46,456 Reputation points
2021-12-01T07:13:56.483+00:00

Hi @Macháček Martin

Currently, the update of sharepoint listitem with hyperlink field is not supported. There was a similar problem on github before, but it has not been resolved yet. I suggest you submit a user voice to add a support request for updating hyperlink column, and I'll vote for you.


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

2 people found this answer helpful.

Answer accepted by question author

MARTIN MACHACEK 80 Reputation points MVP
2026-05-14T10:01:18.2166667+00:00

@phmb There is one solution:

Internally, the request is routed to the internal SharePoint API, which doesn't support creating or updating a hyperlink field. Beta version of the internal SharePoint API has support for the hyperlink field.

You can enforce the request to be routed to the beta version of the internal SharePoint API by adding the Prefer:apiversion=2.1 header to your request.

Create a hyperlink field:

POST https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items
Content-Type: application/json
Prefer: apiversion=2.1
{
  "fields": {
    "Title": "Project1",
    "ProjectUrl": {
      "Description": "Project 1 home site",
      "Url": "https://www.project1.com"
    }
  }
}

Update the hyperlink field:

https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{list-item-id}/fields
Content-Type: application/json
Prefer:apiversion=2.1
{
  "ProjectUrl": {
    "Description": "Project 1 Home Site",
    "Url": "https://www.project-1.com"
  }
}

With the Prefer: apiversion=2.1 header, the request will succeed and the hyperlink field will be updated.

Be aware that the request will be routed to the beta version of the internal SharePoint API, which means that the functionality might change in the future.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.