0
votes

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

3 Answers

0
votes

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" -->
0
votes

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!

0
votes

I created following script to fetch all internal FieldNames for a list

  1. Go to Sharepoint List in browser
  2. Navigate to Edit List definition. It should contain columns list of List
  3. 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))); })