-
Couldn't load subscription status.
- Fork 261
Description
Hi
I am not sure where to address this issue, but I am seeing it in both Graph Explorer and msgraph-sdk-dotnet.
The problem/bug is that when either:
- Creating af Sharepoint List Column or
- Updating an existing Sharepoint List Column
Then is is possible to set almost all elements for the Column, but not the DefaultValue.
I can see on StackOverflow that there is another report, but I have not managed to find a solution:
Issue on StackOverflow
Reproduce:
Test-1 - Graph Explorer - Update existing Sharepoint List Column
- In Graph Explorer - construct the Column to PATCH (example below is a textColumn):
e.g.: https://graph.microsoft.com/v1.0/sites/"siteId"/lists/"listId"/columns/"columnId"
Body:
{ "defaultValue": { "value": "cba" } } - Press "Run Query"
The response Preview shows the updated Column, but the "DefaultValue" has not changed (I have tried including other parameters as e.g. "required" and "displayName" which updates correctly).
Test-2 - msgraph-sdk-dotnet - Creating a new Column (example below is a choiceColumn but I have also tried textColumn):
- Snippet of the C# code to create - example:
Microsoft.Graph.ColumnDefinition column = new Microsoft.Graph.ColumnDefinition { DisplayName = "Choice Field", Name = "ChoiceField", Choice = new ChoiceColumn { ODataType= "microsoft.graph.choiceColumn", AllowTextEntry = false, Choices = new List<string>() { "Yes", "No", "" } }, DefaultValue = new DefaultColumnValue { Value = "No" }, Description = "Description of the Column", Required = true }; Microsoft.Graph.ColumnDefinition newColumn = await graphClient.Sites["<siteId>"].Lists["<listId>"].Columns.Request().AddAsync(column); - The Column is created with all settings - except the DefaultValue.
Could you please help with either redirecting the bug (if it actually is a bug) or tell me if I am missing something regarding the DefaultValue / DefaultColumnValue.
EDIT: After investigating, then I can attach the DefaultValue if I set it when creating the List - however it does not solve the issue regarding Adding/Editing a List Column.
Best Regards,
Martin