Forum Discussion
Etienne Fortin
May 15, 2017Copper Contributor
Adding Sharepoint Lookup Item With Graph
I'm experimenting with Graph (Beta) with Sharepoint. I can create items and update their fields. It works for simple fields like text andnumbers. Howerver, I can't figure out how to update fields li...
Ketill Antoníus Ágústsson
Aug 08, 2017Copper Contributor
I am now faced with the same task, did you figure out how to do it?
Etienne Fortin
Aug 21, 2017Copper Contributor
Unfortunetely not. Can't figure out how to do it.
- Ketill Antoníus ÁgústssonAug 22, 2017Copper Contributor
Too bad :(
But are you successfully calling the view-items endpoint:
/beta/sites/{site-id}/lists/{list-id}/items
and getting a non-null response?
Because all I get as a response is:
{ "@odata.context": "https://graph.microsoft.com/beta/...", "value": [] }
- Etienne FortinSep 06, 2017Copper Contributor
I'm getting a non null response to my queries.
- Brent EllisAug 21, 2017Silver ContributorFor the lookup, have you tried JUST passing the Integer value of the target item?
- Etienne FortinAug 21, 2017Copper Contributor
I'm not sure I understand. Can you put out a json quick exemple of the PATCH http request that would follow what you are suggesting?
- Brent EllisAug 21, 2017Silver Contributorjust pass the value like you would a string
Maybe if your lookup is called "lookupField", I think it uses a secondary internal fieldname with "Id" appended to the end of it. This is how we have to do it for csom or spd web services, so I'd imagine its the same for Graph.
"lookupFieldId": "80",
or
"lookupFieldId": 80,