Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Adding List Item of Hyperlink Field Type When URL Contains Comma (,) #1604

Open
1 task done
ahamedfazil opened this issue Jan 31, 2025 · 1 comment
Open
1 task done

Comments

@ahamedfazil
Copy link

Category

  • Bug

Describe the bug

I am encountering an issue when adding a list item that includes a hyperlink field. I followed the instructions from the PnP Core SDK documentation (https://pnp.github.io/pnpcore/using-the-sdk/listitems-intro.html#adding-list-items) and used FieldUrlValue in my C# function.

While debugging, I can see that the URL is fully valid, even with a comma. However, after the item is added, the URL in the SharePoint list item is truncated at the comma. For example, if the URL is http://example.com/purpose,scope.aspx it gets saved as http://example.com/purpose in the SharePoint list item.

Url without comma works fine.

Steps to reproduce

Please refer to the screenshot below

Image

Image

Expected behavior

The hyperlink field should contain full url even it has comma in it.

Environment details (development & target environment)

  • SDK version: [PnP.Core - 1.14.0 ]
  • OS: [e.g. Windows 11]
  • SDK used in: [e.g. Function App v4 - 4.5.0]
  • Framework: [e.g. .NET v6.0 ]
  • Tooling: [Visual Studio 2022]

Thanks for your contribution! Sharing is caring.

@pschaeflein
Copy link

I would try encoding the comma ( %2C ).

While a comma is a valid character in a url, SharePoint uses a comma to separate the two parts of the Hyperlink column (url and description).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants