msgraph-sdk-powershell
msgraph-sdk-powershell copied to clipboard
Cannot Use Update-MgSiteListItem or New-MgSiteListItem With a Hyperlink Field
Thanks for reporting the bug. Please ensure you've gone through the following checklist before opening an issue:
- Make sure you can reproduce this issue using the latest released version of Microsoft.Graph or Microsoft.Graph.Beta.
- Please search the existing issues to see if there has been a similar issue filed.
- For issues related to authentication and service errors, please refer to our troubleshooting guide. For service issues, please open a question at https://developer.microsoft.com/graph/support.
Describe the bug
Try to add data to a SharePoint Hyperlink field either when creating a new item or modifying an existing item always returns an error (400 Bad Request Transfer Encoding)
To Reproduce Steps to reproduce the behavior:
- $Params = @{ fields = @{ __metadata = @{ type = "SP.Data.ListNameListItem" } Link = @{ __metadata = @{ type = "SP.FieldUrlValue" } Description = "Test" URL = "https://google.ca" } } }
- Execute Update-MgSiteListItem -SiteId $SiteId -ListId "Name of List" -ListItemId 186 -BodyParameter $Params
- See error Bad Request
Expected behavior
To be able to populate the field. This action works in PnP.PowerShell but not in MgGraph. I tried with an without
Debug Output
Run the problematic command with
-Debugand paste the resulting debug stream below. ⚠ ATTENTION: Be sure to remove any sensitive information that may be in the logs.
Module Version
2.11.1
Environment Data
PSVersion 7.4.1 PSEdition Core GitCommitId 7.4.1 OS Microsoft Windows 10.0.17763 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0..} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
I have been able to use everything else for these cmdlets without issue.
I think that PnP.PowerShell works different endpoint than Graph PowerShell SDK.
What I remember, creating/updating hyperlink field is not supported through the Graph API.
https://github.com/microsoftgraph/microsoft-graph-docs-contrib/issues/8040
Hi @DanielRumeo thank you for logging this issue. As per the API documentation here, hyperlink seems not to be part of the updatable properties.
For API related issues/questions we are not best placed to give an answer. Kindly raise an issue here https://developer.microsoft.com/en-us/graph/support so that the API owner can respond to it.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.