I'm stuck to something probably very basics

So the idea is the following: I have a list with 4 columns : Title, CostCenter, City, currency

Via CSOM, I'd like to read this list, so I did something like that:

ClientContext SPcontext = new ClientContext("MySharepointsite");
         Web web = SPcontext.Web;

         List list = web.Lists.GetByTitle("ListTest");
         CamlQuery query = CamlQuery.CreateAllItemsQuery(100);
         ListItemCollection items = list.GetItems(query);

         foreach (ListItem listItem in items)

              Console.Writeline(FieldName = listItem["Title"].ToString());


But it returns me the following error message:

Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException: 'The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.'

I know that it's comming from my line:


because I remove it, it works

Any idea of how could I do that?

Thank you for your help :)

2 Answers 2


Try replacing this line:


with this:

SPcontext.Load(items, its => its.Include(item => item["currency"], item => item["Title"], item => item["CostCenter"], item => item["City"]));

That way you are asking for specific columns to be downloaded from server.


Since City is not a default list field, you will have to specifically include it in your load call.
Title, CostCenter, City, currency

SPcontext.Load(items, items => items.include(item => item["Title"], item => item["City"], item => item["CostCenter"], item => item["currency"]));

Any time custom columns are being retrieved, they have to be specifically asked for.

as a template

SPcontext.Load(<ItemCollection>, <Variable for item collection> => <variable for item collection>.include(<variable for item> => <variable for item>["<field name"], <variable for item> => <variable for item>["<field name"]));


SPcontext.Load(itemCollection, col => col.include(i => i["Title"], i => i["Description"]));

Your Answer

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

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