This project has moved and is read-only. For the latest updates, please go here.


Apr 4, 2014 at 2:44 PM
Can GetListItems be used on a custom column. I am trying to display a custom column that is a hyperlinked picture. I want to know if this can get that field and display it correctly.
Apr 4, 2014 at 5:28 PM
You can retrieve any column in any list. You may need to parse the results so that they display correctly, though. In the case of a Hyperlink or Picture column, the result is:

link, link text

Apr 9, 2014 at 6:13 PM
here is my issue. I can get it to work for title. How do I find the $(this).attr("Name") for the other fields

$(document).ready(function() {//-----------SPSERVICES GET ALL LIST ITEMS FROM VendorCategory
    operation: "GetListItems",
    async: false,
    listName: "VendorCategory",
// CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
CAMLViewFields:  "<ViewFields xmlns=''><FieldRef Name='CategoryImage' /></ViewFields>",
    completefunc: function (xData, Status) { alert("Test2");

     $(xData.responseXML).SPFilterNode("z:row").each(function() { //--------FIND EACH RECORD FROM VendorCategory 
// $(xData.responseXML).find("[nodeName='z:row']").each(function() {
//  var liHtml = "<li>" + $(this).attr("ows_Title") + "</li>";
            var liHtml = "<li>" + $(this).attr("CatergoryImage") + "</li>";
Apr 9, 2014 at 6:44 PM
The result attributes will all have ows_ as prefixes.

So if your column's StatisName were "MyName", you'd use $(this).attr("ows_MyName".

Apr 11, 2014 at 6:21 PM
Ok I am almost to the finish line. You have been a huge help. Last question. I get the column My issue is I get the information on the column that is on input. I want to get it from an all items view. So here my setup

My field in categoryImage

you add a link to the page you want to call. You add a link to the image.

on the all items view I see a click able image.

when I run my jquery it just puts the 2 links on the page for each item. Any Idea how I can make it pull back the actual clickable image?
Apr 11, 2014 at 6:53 PM

I really can't follow your post. Can you try again?

Apr 14, 2014 at 3:14 PM
ok I have a field Called category image. On input it asks for 2 urls. One to a image and the second to a link. on display of the field it is a clickable image that will take the user to a view of another list. When I run the code above it will return the 2 urls for each item in the list. I want it to return the clickable image. Does that make sense?
Apr 16, 2014 at 1:23 PM
Not sure if that made sense. If not please let me know
Apr 16, 2014 at 1:30 PM
Edited Apr 16, 2014 at 1:30 PM
The URL image is in the returned XML from the GetListItems call, correct? Since you have the URL to the image (static name is "CategoryImage") and the associated link is in the same record (I'm assuming with a static name of "Title"), you can create an link with an image tag something like...
"<a href='" + $(this).attr("ows_Title") + "'><img src='" + $(this).attr("ows_CategoryImage") + "' border=0 /></a>"
Marked as answer by DavidLewis27 on 4/17/2014 at 12:23 PM
Apr 16, 2014 at 2:22 PM
I appreciate the attempt. I don't think this will work. My categoryimage is a custom column that you input 2 parameters, the first input is the link to the image. The second input is the link the clickable image takes you to. So here is an example. I input a url to a image of a pc like /images/pc.jpg . The second link I input goes to something like On the all items display it shows the image of the pc and when you click on it it takes you to When I run the jquery I get back /images/pc.jpg and I need it to pull the clickable picture not the 2 links.
Apr 16, 2014 at 5:32 PM
Edited Apr 16, 2014 at 5:34 PM
Hyperlink or Picture columns do take two values, but they aren't two images. The first is the hyperlink, the second is the text that SharePoint will normally display when you see the link. These two values are stored in the column like "link, link text". So if you just want the link, you split on the comma and take the first element; if you just want the text, you take the second.
var thisLink = $(this).attr("ows_CategoryImage").split(",");
var out = "<a href='" + thisLink[0] + "'>" + thisLink[1] + "</a>";
The other alternative is to just use a Single line of text column to hold the link if you don't need SharePoint to understand that it's a link.

Marked as answer by DavidLewis27 on 4/17/2014 at 12:23 PM
Apr 16, 2014 at 7:31 PM
Edited Apr 16, 2014 at 7:57 PM
I hope this will shed some light
So a user will add items to the list the following way. They will add values to the 3 fields.
Notice that categoryImage will take a web address as well as a picture address

The default allitems.aspx will appear like below. The categoryimage is a clickable button taking you to specific sharepoint pages
When I run the jquery I supplied in my issue the results are displayed below

So my question is how do I get category image to look like the second image?
Apr 17, 2014 at 12:26 AM
Edited Apr 17, 2014 at 12:32 AM
OK, I'm not sure what column type the CategoryImage is, but it's not an out of the box column type.

My guess is that the two parts will still be stored separated by a comma. You'll have to see what you get back from the GetListItems call.


This is what an out of the box Hyperlink or Picture column would look like in the form:
Apr 17, 2014 at 2:36 PM
I can see the comma delimiter in the screenshot. The content to the left of the comma is relative link to an aspx page and the content to the right of the comma is a relative path to the image source.
Apr 17, 2014 at 7:42 PM
ahhh never mind between what you both gave me I got it to work. Thanks for all the help. You guys saved me