none
How to get Internal names of columns in sharepoint lists?

    Question

  • 1) I want to get the internal name of the column of sharepoint list.

    2) This may possible that the internal name may contains spacesa and special symbols.

    3) I want to pass a display name of a column and get it's internal name.

    4) It is using webservice to fetch the list data in a seperate .Net [workbook] application.

     

    • Edited by ooday Tuesday, December 07, 2010 6:15 AM
    Monday, December 06, 2010 12:12 PM

Answers

  • You can get the internal name for a column by browsing to the List Settings > Edit Column and look at the QueryString.  This will be url encoded but is a simple way of retrieving the internal name without writing any code.  You will get something like:

    /_layouts/FldEdit.aspx?List=%7B37920121%2D19B2%2D4C77%2D92FF%2D8B3E07853114%7D&Field=Product%5Fx0020%5FDescription

    %5F is a '_'.  The field name is Product_x0020_Description.

    The code option is to use:

    string itemInternalName = item.Fields["Field Display Name"].InternalName;

    Hope this helps

    Dave


    My SharePoint Blog - http://www.davehunter.co.uk/blog
    Monday, December 06, 2010 12:28 PM

All replies

  • You can get the internal name for a column by browsing to the List Settings > Edit Column and look at the QueryString.  This will be url encoded but is a simple way of retrieving the internal name without writing any code.  You will get something like:

    /_layouts/FldEdit.aspx?List=%7B37920121%2D19B2%2D4C77%2D92FF%2D8B3E07853114%7D&Field=Product%5Fx0020%5FDescription

    %5F is a '_'.  The field name is Product_x0020_Description.

    The code option is to use:

    string itemInternalName = item.Fields["Field Display Name"].InternalName;

    Hope this helps

    Dave


    My SharePoint Blog - http://www.davehunter.co.uk/blog
    Monday, December 06, 2010 12:28 PM
  • HI,

    Refer below link, which may useful for you.

    http://www.sharepointdevwiki.com/display/public/Getting+the+Field+by+the+Internal+Name


    Thanks & Regards, Neerubee
    Monday, December 06, 2010 12:40 PM
  • Hi,

    Thanks to Dave's reply. You can follow Dave's way but I would like to share mine as well.

    http://www.u2u.net/res/Tools/CamlQueryBuilder.aspx

    Download this utility and open your desired sharepoint site, pick up the desired list, scroll for columns for that list (should appear in dropdownlist) and build a simple query. It will always show you the column internal names [ like  <FieldRef Name='Product_x0020_Info' /> ] and also a handy tool for building CAML queries as well which you might need in future.

    Thanks


    Operation completed successfully. ========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========
    Monday, December 06, 2010 12:45 PM
  • It doesn't use List Settings, but here is my quick method of uncovering the internal name of a column.  For the list in question, open the New item form.  View the source of the form and search for "FieldInternalName".  Each field on the form has a commented area that contains the Fieldname, FieldInternalName, and FieldType.  Here is an example:

    <!-- FieldName="Comments"
    FieldInternalName="Comments"
    FieldType="SPFieldNote"
      -->
    Hope this helps...
    - Tom
    • Proposed as answer by Lavish0610 Wednesday, March 19, 2014 8:36 PM
    Monday, December 06, 2010 1:59 PM
  • Hi Sharepoint Tom,

    I know my method does not use List Settings but CAML utility is a good way to find internal names (I thought I should share). I use to follow your method before and it is also a good one. Thanks for sharing.

    Thanks


    Operation completed successfully. ========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========
    Monday, December 06, 2010 2:14 PM
  • Thanks for you reply buddies
    Tuesday, December 07, 2010 6:16 AM
  • One thing I found is that Internal names are sometimes truncated.  I created a field called "Expected Remediation Date" and SharePoint truncated the internal name to "Expected_x0020_Remediation_x0020"

    Basically left off the "_Date".

    Wednesday, November 28, 2012 12:57 PM
  • You can use the InternalName property to get this details, check the article "How to get Internal names of columns in sharepoint lists" at http://tad.co.in/?p=919

    http://tad.co.in

    Wednesday, December 05, 2012 9:12 AM