Getting The Full, Absolute URL Of A ListItem In Office 365

I don't know why Microsoft made it such a pain in the ass to get the url for most of the proxy objects on the SharePoint server object model, but in Office 365 it is even worse. Here is an example of how to get a ListItem actual URL and the modified date of the item. Following I will throw the values into a dictionary.


Dictionary urlDict = new Dictionary();
foreach (List list in ListsToProcess)
ListItemCollection items = list.GetItems(CamlQuery.CreateAllItemsQuery());
foreach (SharePointListItem item in items)
list.Context.Load(item, x => x["FileRef"], x => x["Modified"]);
string startUrl = list.Context.Url;
string fullUrl = startUrl + item["FileRef"];
string lastModified = item["Modified"].ToString();
if (!urlDict.ContainsKey(fullUrl))
urlDict.Add(fullUrl, lastModified);



One thought on “Getting The Full, Absolute URL Of A ListItem In Office 365”

Leave a Reply

Your email address will not be published. Required fields are marked *