0
votes

To update a 'simple' field item in sharepoint we can patch using the graph api: https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}/fields using

{ "td_documentLookupId":"22" }

But how to perform an update if the required structure is a nested json`enter code here:

{         
   "td_documentLookupId":"22",
   "td_object":{
                "LookupId":7,
                "LookupValue":"title"
                }
}

This returns an invalid request. Any help is appreciated!

1
May I know how did you create these properties?Shiva Keshav Varma
They were configured in sharepoint. The api lets me query them: "fields":{ "@odata.etag":"\"xxx"", "FileLeafRef":"8000-W8-PRO-PID-DO-0001 6.0.pdf", "Title":"Straat 1", "td_documentLookupId":"22", "td_object":[ { "LookupId":7, "LookupValue":"Nabezinktanks" }, { "LookupId":8, "LookupValue":"Retourslibsysteem" } ],GercoWeststeijn
Try something like this { "td_documentLookupId":"22", "td_object":[{ "LookupId":7, "LookupValue":"title" }] }Shiva Keshav Varma
Let me know if that works.Shiva Keshav Varma
This returns: "invalid request" as wellGercoWeststeijn

1 Answers

0
votes

I found the following to work for the above case, using PATCH protocol:

                         {         
                            "td_documentLookupId":"22",
                            "[email protected]": 'Collection(Edm.Int32)',
                            "td_objectLookupId": [7]                        
                          } 

td_objectLookupId is a multiselect list. As per above it can retrieve a list of values e.g. [7,8,9]