<CharlieDigital/> Programming, Politics, and uhh…pineapples


Updating User Fields via ListData.svc

Posted by Charles Chen

Just putting this out there since I didn't find any info out there.  If you're using the ADO.NET REST data services to update user fields, you can't just set it like so:

{"AssignedTo" : "3;#Charles Chen"} // No good!
{"AssignedTo" : "DEV\\cchen"} // Nope!
{"AssignedTo" : {"Account" : "DEV\\cchen"}} // Nope!

You have to do it using a reference to the users list:

// Put the integer ID of the user in the ( )
{"AssignedTo" : {"__metadata" : {"uri" : "UserInformationList(2)"}}}

Not very developer friendly, it seems.

On the topic of the SharePoint REST services, Justin Lee has a great post that gives a quick overview of the core functionality.

Filed under: SharePoint No Comments