var clientContext = SP.ClientContext.get_current();
 var lists = clientContext.get_web().get_lists();
 var oList = clientContext.get_web().get_lists().getByTitle(listName);
 var collListItem;
var camlQuery = new SP.CamlQuery();
    var viewXML = "<View Scope='RecursiveAll'><ViewFields>" +
"<FieldRef Name='FullName' />" +
"<FieldRef Name='JobTitle' />" +
"<FieldRef Name='CompanyDepartment' />"+
collListItem = oList.getItems(camlQuery);

    function () {
        // We have the elements
        var listItemEnumerator = collListItem.getEnumerator();
         // It's easy to iterate and get the column values of an item
        while (listItemEnumerator.moveNext()) {
            var cItem = listItemEnumerator.get_current();

            var Obj = {

            console.log(Obj );


    function (sender, args) {
        console.log('Error getting list items: ' + args.get_message());

in My Code its obvious im retrieving some values from custom list with custom columns i created a column for the list called "JobTitle" and when i tried to retrieved in the while loop cItem.get_item('JobTitle') it threw an Error that field not initialized so i consoled out the cItem and i found that my firld name is "JobTitle1" "1" added at the end i dunno why and i wanna know how to know the real names of the fields thanks

  • I guess by now you understand the difference between display name and internal name. Just want to get your attention to query. You are creating a view but not setting the view in the camlquery object. As it is now, your code is not limiting the results to those fields only. Jan 30, 2015 at 16:28
  • so what if i want it to limit'em ? Jan 30, 2015 at 21:40
  • @NadeemYousuf can you please send some resourse for simple explaining for this CamlQuery ? Jan 30, 2015 at 23:17

2 Answers 2


If there was already a JobTitle column, and another was created, it would append a 1 to the end of it. The easiest way to check the internal column names is to go into the list/libary settings and click on the column. This will open the properties of the column, and the URL in the address bar will show the internal column name for use in CAML/Javascript.

Personally, I do this often, because I want consise column names. When I create them, I'd create it as JobType to set the internal name then edit the column to give a display name like Job Type. Display name does not always equal static name and using this trick, or things like the BIWUG CAML Designer help.


Those are field's internal names. You can find it by

  1. Open List Settings
  2. Then Hover mouse over the field (its a hyperlink)
  3. Look for a querystring with name Field

Another option is to use SharePoint Manager. It is a windows form application which gives you much more details.

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.