How can I create a list with a hyperlink column

Bill King 65 Reputation points
2024-07-04T02:23:50.86+00:00

I am trying to create a sharepoint list using the Microsoft Graph API. I can create a list with all text columns, but if I try to create a column with a hyperlink, I get a 503 "service unavailable" after about 5 minutes.

The url I am POSTing to is: https://graph.microsoft.com/v1.0/sites/{site-id}/lists
and the post body is:

{
    "displayName": "Document Status",
    "columns": [
        {
            "name": "DocumentId",
            "indexed": true,
            "hyperlinkOrPicture": {
                "isPicture": false
            }
        },
        {
            "name": "DocumentType",
            "text": {}
        }
    ],
    "list": {
        "template": "genericList"
    }
}

If I change the hyperlinkOrPicture to text: {} the list is created

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,422 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,274 questions
0 comments No comments
{count} votes

Accepted answer
  1. AllenXu-MSFT 18,361 Reputation points Microsoft Vendor
    2024-07-09T05:53:01.0833333+00:00

    Hi @Bill King,

    Sorry for my late response. And yes, the timeout is caused by unsupported Hyperlink or Picture column for indexing. User's image

    Also, it is true that currently creating list items with hyperlink fields is not supported by Graph Api. I recommend you give suggestion in the feedback portal and help to make improvements. Many features of current products are designed and upgraded based on customers’ feedback. With requirements like this increase, the problem may well be released in the future. I will vote for you.

    Thanks.

    Have a good day.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. AllenXu-MSFT 18,361 Reputation points Microsoft Vendor
    2024-07-04T06:57:02.57+00:00

    Hi @Bill King,

    Modify the below request body to blow.

    {
        "displayName": "Document Status",
        "columns": [
            {
                "name": "DocumentId",
                "indexed": true,
                "hyperlinkOrPicture": {},
                "isPicture": flase
            },
            {
                "name": "DocumentType",
                "text": {}
            }
        ],
        "list": {
            "template": "genericList"
        }
    }
    
    
    

    enter image description here


    If the answer is helpful, please click "Accept as 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.