3

is there a way to add and retrieve values from the property bag of a list item using CSOM? I am using sharepoint 2013, all my searches come up empty for the list item, and I know in sharepoint 2010 it was not posible.

I would very much like to know if it can be done and how.

Thanks in advance.

2 Answers 2

2

I think that it's not possible. ListItem class doesn't expose any property or method to operate on property bag.

0
1

Get Property

var lst= ctx.Web.Lists.GetByTitle(listTitle);
ctx.Load(lst, l => l.RootFolder.Properties);
ctx.ExecuteQuery();
var value = lst.RootFolder.Properties[key];

Set Property

var list = ctx.Web.Lists.GetByTitle(listTitle);
var lstProps= list.RootFolder.Properties;
lstProps[key] = value;
lst.RootFolder.Update();
ctx.ExecuteQuery();
1
  • That is for list property, I am looking for list item property bag
    – jvr
    Feb 23, 2017 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.