• 3 ways to find SharePoint list field’s Internal name

    by  • May 11, 2010 • MOSS 2007, PowerShell • 4 Comments

    Update: If you want a quicker solution, please check out my new CAML Viewer Web Part for SharePoint 2010.

    While working with caml query there may be cases where we may need to refer internal name of a sharepoint list and in some of the cases the display name and internal name may be different. If you try to access this list we will get object not found error.

    We can find out the sharepoint field’s internal name using any of the following ways
    1. Using browser (it applies to custom fields only)
    Go to list settings -> Edit column. Then you can see field name from the query string

    2. Object model (it applies for custom fields as well as system fields)

    string siteUrl = "http://mysite";
    SPSite site = new SPSite(siteUrl);
    SPWeb web = site.OpenWeb();
    SPList list = web.Lists["my forum"];
    for (int i = 0; i < list.Fields.Count; i++)
    Console.WriteLine(list.Fields[i].Title + "..." + list.Fields[i].InternalName + "...");
    Console.ReadLine();
    

    3. Powershell (it applies for custom fields as well as system fields)

    [system.reflection.assembly]::loadwithpartialname("microsoft.sharepoint")
    $site= New-Object Microsoft.SharePoint.SPSite ("http://mysite")
    $web=$site.OpenWeb()
    $list=$web.Lists["my forum"]
    $list.Fields |select title, internalname| more
    

    About

    Hojo Clement was working in US Technology in Trivandrum as a Senior Software Engineer. He has 6 years experience in working with Web Development Technologies inlcuding MOSS and ASP.net.

    4 Responses to 3 ways to find SharePoint list field’s Internal name

    1. Christos K
      August 17, 2010 at 11:43 am

      Nice!

    2. Gijo Palladan.
      September 28, 2010 at 4:08 am

      good one ,

    3. Richard Morris
      January 18, 2012 at 11:26 pm

      Excellent – thank you!

    4. Al
      February 1, 2012 at 5:50 pm

      Saved my life today

    Leave a Reply

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