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 got one custom boolean column/field which I want to check if it exists or not before checking its value, currently I am using this code but it ain't working like it should,

    using (SPWeb web = properties.OpenWeb())
        SPList list = web.Lists["List Name"];

        foreach (SPListItem listItem in list.Items)
            if (listItem.Properties["Boolean Property"] != null &&
                    bool.Parse(listItem.Properties["Boolean Property"].ToString()) == false)

I am using .Net framework 3.5 so can't use fieldexsist property.

share|improve this question
up vote 5 down vote accepted

listItem.Properties will show metadata properties, not fields. Not sure which one you want.

I use the following to check if a field exists:


Likewise, for metadata properties you can use:

listItem.Properties.ContainsKey("property name")
share|improve this answer

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.