microsoftgraph / msgraph-sdk-serviceissues

Tracks service issues for follow up.
5 stars 0 forks source link

Sharepoint list item fields update using the c# Graph API #69

Open sergioacortes opened 5 years ago

sergioacortes commented 5 years ago

Hi,

I am trying to use this library to update the fields of a Sharepoint list item, but I get the a ServiceException

Microsoft.Graph.ServiceException: Code: generalException Message: An unspecified error has occurred. Inner error at Microsoft.Graph.HttpProvider+d__19.MoveNext () [0x002e9]

This is the code I am using, I found on an issue marked as solved.

var fields = new FieldValueSet(); var changes = new Dictionary<string, object>() { { "proveedor", $"{this.SharepointListItem.Description} - changed" } };

fields.AdditionalData = changes; await client.Sites["root"].Lists[this.SharepointListId].Items[this.SharepointListItem.ListItem.Id].Fields.Request().UpdateAsync(fields);

Could you please give me some update of what's going on? Hoping your kind answer.

AB#7348

sergioacortes commented 5 years ago

image to microsoft

MIchaelMainer commented 5 years ago

902787 - Can you provide us with the sanitized request and response? I'd like to understand whether this is a client or service issue.

MIchaelMainer commented 5 years ago

I deleted the comment as the attachment contained PII. This is certainly a service issue or limitation. Have you gotten past this issue?

sadsocket commented 5 years ago

I'm actually experiencing the same issue trying to update a multichoice list item, like so. "Tags" is a List:

            await graphClient.Sites[SPUrl + ":"].Sites[SpPath + ":"].Lists[libId].Items[item.SharepointIds.ListItemId].Request().UpdateAsync(new ListItem()
            {
                Fields = new FieldValueSet
                {
                    AdditionalData = new Dictionary<string, object>
                    {
                        { "Phase@odata.type", "Collection(Edm.String)" },
                        { "Phase", tags }
                    }
                }
            });

Trying it without setting the odata.type in AdditionalData was causing the error: "A value without a type name was found and no expected type is available. When the model is specified, each value in the payload must have a type which can be either specified in the payload, explicitly by the caller or implicitly inferred from the parent value."

petrhollayms commented 5 months ago

Thank you for reporting this issue. This appears to be an issue or limitation with the service APIs. Unfortunately, as the Microsoft Graph SDK team, we do not have ownership of the APIs that are causing you issues. We invite you to create a question about the service API to Microsoft Q&A and tagged with one of the [microsoft-graph-*] tags, that way it will get routed to the appropriate team for them to triage:

https://aka.ms/msgraphsupport or directly https://aka.ms/askgraph

For now, we will close the issue on our side but feel free to open it in the relevant repository if you think the issue is specific to SDK. Please let us know if this helps!

Note: We will close this repository on April 19, 2024.