Getting Internal Name of a Share Point List Fields

Posted by Gino Abraham on Geeks with Blogs See other posts from Geeks with Blogs or by Gino Abraham
Published on Thu, 10 Mar 2011 12:38:42 GMT Indexed on 2011/03/10 16:11 UTC
Read the original article Hit count: 352

Filed under:

Over the last 2 weeks i was developing a tool to migrate Lotus notes data base to Share point. The mapping between Lotus notes schema and share point list schema was done manually in an xml file for out tool. To map the columns we wanted internal names of each field. There are quite a few ways to achieve this, have explained few below.

If you want internal names for one or 2 columns you can do so by navigating to the list setting and clicking on the column name. Once you are in column's details, you can check the query string of the page. The last item in the query string would be field's internal. Replace all "%5f" with '_' will give you the field internal name.

In my case there were more than 80 columns. I used power shell to get the list of columns with details.

Open windows Powershell and paste the following script after modifying the url and list name.

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

$site = new-object Microsoft.SharePoint.SPSite(http://yousitecolurl)

$web = $site.OpenWeb()

$list = $web.Lists["yourlist name"]

$list.Fields | Format-Table Title, InternalName, TypeAsString

I also found a tool in Codeplex.com which can generate a wrapper class for a list. The wrapper class will give you the guid and internal name for all fields in the list.  You can download the tool from http://imtech.codeplex.com/

Just enter the url in the text box and hit open. All the site content will be listed at the left hand side, expand the list, right click and select generate wrapper class.

 

© Geeks with Blogs or respective owner