SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to get a collection of .pdf files from a certain document library, as well as their fields and values. I need three of them - DisplayName, "Barcode"(custom) and "Document Type"(also custom).

Currently I am getting the list collection like this

 CamlQuery camlQuery = new CamlQuery();
            camlQuery.ViewXml =
                      <FieldRef Name='File_x0020_Type'/><Value Type='Text'>pdf</Value>
                ListItemCollection listItems = CurrentChosenLibrary.GetItems(camlQuery);
                clientcontext.Load(listItems, items => items.Include(
                    item => item.DisplayName,
                    item => item["Barcode"],
                    item => item["Document_x0020_Type"],
                    item => item.HasUniqueRoleAssignments));

Now, they all load properly. However, changing them like this:

                        item["Barcode"] = "Rafal was here";
                        item["Document_x0020_Type"] = "Here as well";

...does not do anything. What am I doing wrong?

share|improve this question
up vote 1 down vote accepted

Did you try running this after update:

share|improve this answer
God, that took me a bloody hour of trying and figuring out! Thanks so much, eirikb! – Rafał Saltarski Sep 20 '12 at 11:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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