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.

1 Answer 1


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")

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.