In SharePoint list I know the field display name.

Using display name I want to get Internal name of field,

string FieldName = "Test Field";
SPField field = olist.Fields.GetFieldByInternalName(fieldname);

Test Field is display name using this how can i get the internal name of field without using foreach loop.

1 Answer 1


You can use it as below:

string FieldName = "Test Field";

//you can pass the display name, internal name of static name in the GetField method
SPField field = olist.Fields.GetField(FieldName);

var fieldInternalName = field.InternalName;

According to this - SPFieldCollection.GetField , the GetField methods gives you the field data by passing it a string with either internal, display, or static name of the field.

Or alternatively, you can use it as below:

string FieldName = "Test Field";    

//accepts the fields display name only
SPField field = olist.Fields[FieldName];

var fieldInternalName = field.InternalName;

Reference - SPFieldCollection property to get the field data.

After that, you can use the InternalName and fetch your value.

Reference - SPField.InternalName

  • in my case both its not working if i am using this SPField field = olist.Fields.GetField(FieldName); error - Column 'Test Field' does not exist. It may have been deleted by another user. if i am using this SPField field = olist.Fields(fieldname); //It was throwing Excpection.
    – Elina
    Commented Aug 11, 2017 at 10:46
  • thats quite strange, can you check if the spaces are correct or if the display name has some other characters ? you can go to list settings and check that Commented Aug 11, 2017 at 11:18

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.