Issue with Posting Hyperlink to SharePoint List using Microsoft Graph in UiPath

Hello,

I’m encountering an issue when trying to post a hyperlink to a SharePoint list using Microsoft Graph within UiPath. I’m trying to create a new list item with a field type ‘Hyperlink or Picture’, but my requests are consistently met with a BadRequest error, indicating that the format of my hyperlink is not recognized.

Here’s what I’ve tried:

  1. I’m using a Dictionary(Of String, Object) in VB.NET to construct the JSON payload for the Microsoft Graph API request.
  2. The hyperlink field is formatted as a dictionary with Url and Description keys:

New System.Collections.Generic.Dictionary(Of String, Object) From { {"URLLink", New With { Key .Url = "https://google.com", Key .Description = "Google" }}}

I’ve verified that the internal names of the SharePoint columns are correctly used.

The authentication process and setting of the access token in the HTTP client’s default request headers are functioning correctly.

@DragosPadurariu

Try this

New System.Collections.Generic.Dictionary(Of String, Object) From { {"URLLink", New System.Collections.Generic.Dictionary(Of String, String) From { {"Url":"https://google.com"}, {"Description":"Google"}}}}

Cheers

It still doesn’t work. I called an API the GET request, and the object comes with these 2 properties: Description and Url, like this:

{
    "fields": {
        "URLLink": {
            "Description": "Example Description",
            "Url": "https://example.com"
        }
    }
}

Unfortunately if I put the same object in the post, I get the error.

Endpoint/object serialization works fine because when I use the method on a field that is of type text, everything works properly.

Any other ideas?

The workaround I found was to keep the column as text, but add the data in html format, which looks like a hyperlink column

New System.Collections.Generic.Dictionary(Of String, Object) From {
    {"URLLink", "<a href="""+in_StrURLLink+""" target='_blank'>Link</a>"}
}

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.