Is there a way in SharePoint Designer 2010 to get the internal field names of a list to be used in JavaScript. What I am doing right now is opening the list settings in IE and editing each field (column) to find the internal name in the address bar.
3 Answers
No need for SP Designer.
Open the NewItem
view for the List. Click the add new item
option.
Open the Developer Tools for the Browser you are using. F12 in Internet Explorer / Edge.
Use the equivalent of the DOM explorer for your browser and click on the field of interest.
This is the DOM explorer guide for IE11 https://msdn.microsoft.com/en-us/library/dn255008(v=vs.85).aspx . If you are using another browser and can't work out how to find the equivalent by yourself post a comment and we'll try and help.
The Display Name
and Internal Name
are written into the generated HTML by Microsoft for every field in the form.
Like this:
<!-- FieldName="This Field Name"
FieldInternalName="ThisFieldName"
FieldType="SPFieldNote" -->
I know you specified using SPD, but I have found this tool incredibly helpful when using javascript with lists.
https://archive.codeplex.com/?p=spcamlqueryhelper
Good luck!
I created following script to fetch all internal FieldNames for a list
- Go to Sharepoint List in browser
- Navigate to Edit List definition. It should contain columns list of List
Run following script in developer mode of browser:
document.querySelectorAll("table[summary='-----'] tr td a[href^=FldEdit]") .forEach(n => { var uri = n.getAttribute('href'); console.log(decodeURI(uri.substr(uri.index0f("&Field")+7))); })