SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been to Jan Tiernans blog, and figured out how to grab column names using Soap and jquery/jscript. I can't figure out how to grab custom columns with special chars though.

I have read about obtaining the internal field names (ie:DB%5fx0020%5fType for a column named 'DB Type'). However, when I use these in code, it does nothing.

I have no access to sharepoint designer, I am doing all of this out of a CEWP. This is what I have (which works wonderfully for any one word column ie - Title and ID):

<script type="text/javascript" src="path to..javascript/Scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="path to..javascript/Scripts/jquery.listmenu-1.1.js"></script>

<script type="text/javascript">
    $(document).ready(function() {
        var soapEnv =
            "<soapenv:Envelope xmlns:soapenv=''> \
                <soapenv:Body> \
                     <GetListItems xmlns=''> \
                        <listName>supported_applications</listName> \
                        <viewFields> \
                            <ViewFields> \
                               <FieldRef Name='Title' /> \
                               <FieldRef Name='ID' /> \
                           </ViewFields> \
                        </viewFields> \
                    </GetListItems> \
                </soapenv:Body> \

            url: "path to.../_vti_bin/lists.asmx",
            type: "POST",
            dataType: "xml",
            data: soapEnv,
            complete: processResult,
            contentType: "text/xml; charset=\"utf-8\""

    function processResult(xData, status) {
        $(xData.responseXML).find("z\\:row").each(function() {
              // var liHtml = $(this).attr('ows_ID') +":   " +$(this).attr('ows_Title')+'<br>';
var liHtml = "<li><a href='path to.../Lists/applications/DispForm.aspx?ID=" + $(this).attr('ows_ID') + "'>" + $(this).attr('ows_Title') + "</a></li>";

    //function appendAnchor(

<ul id="tasksUL"/>

This all works beautifully, but once I sub an 'internal name' (which has special chars) for Title, nothing works

<FieldRef Name='ID' /> \
var liHtml = "<li><a href='path to.../Lists/applications/DispForm.aspx?ID=" + $(this).attr('ows_ID') + "'>" + $(this).attr('ows_Title') + "</a></li>";


 <FieldRef Name='DB%5fx0020%5fType' /> \
 var liHtml = "<li><a href='path to.../Lists/applications/DispForm.aspx?ID=" + $(this).attr('ows_ID') + "'>" + $(this).attr('ows_DB%5fx0020%5fType') + "</a></li>";

I believe from what I have read I must use the prefix 'ows' when reffering to these column names, however I have tried all sorts of different combos of names, nothing doing. What the heck am I doing wrong?

share|improve this question
up vote 1 down vote accepted

Why don't you use SPServices which does a very nice job for you? To get the "usual" attribute you can "unescape" in javascript:


will be: "ows_DB_x0020_Type"

just an example of your code converted to SPServices:

    operation: "GetListItems",
    async: true,
    listName: "supported_applications",
    CAMLViewFields: "<ViewFields><FieldRef Name='ID' /><FieldRef Name='Title' /></ViewFields>",
    completefunc: function (xData, Status) {
        $(xData.responseXML).SPFilterNode("z:row").each(function() {
      var liHtml = "<li><a href='path to.../Lists/applications/DispForm.aspx?ID="
          +$(this).attr('ows_ID') + "'>" + $(this).attr('ows_Title') + "</a></li>";
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.