Skip to main content

Cloud

Ghost Columns in Lists

Sometimes when you delete a column from a list, it does not get deleted completely. If this happens, you don’t see the column in the list settings, but if you try and create a column with the same name, Sharepoint throws an error saying that a column already exists with that name.

If you try and add a site column to the list, it creates the column in the list with the Display name as what is required, but the internal column name is the column name + 0

e.g region0, budget0

To delete this column, I have written a small utility which goes over all the columns and prompts the user if they want to delete the column. When you use the OM to list out all the columns you will find the column that you deleted in fact exists.

I will post the utility in a short while.

But in brief the overall steps are:

  1. Get the fields collection
  2. Get the required field
  3. Set the AllowDeletion property to True
  4. Update the list.
  5. Now go over the fields collection again.
  6. Get the required field
  7. Delete the field.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Amol Ajgaonkar

More from this Author

Follow Us