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

SP2007 UpdateListItems with Hyperlink column

Feb 18, 2013 at 8:45 AM
I have been using SPServices for many months. Terrific library. I have learned lots by just reading the code! Now to the problem.
I have a hyperlink field on a SP2007 list. I am using UpdateListItems with a new cmd. The problem I am having is that SP does not create a link with my update value. I have tried sending HTML, encoded HTML, a plain link, and even the old 'url, url description'. I can create the link on the SP NewForm.aspx page and when read through web services shows up as an HTML anchor. However, feeding the exact same thing back causes sharepoint to just display the anchor as text. Anyone have a pointer for me?
Feb 18, 2013 at 3:42 PM
So is the problem updating a Hyperlink or Picture column with UpdateListItems or just diplaying the link after the update?

Feb 18, 2013 at 11:14 PM
Edited Feb 18, 2013 at 11:29 PM
I have list column that is defined as a hyperlink. I am using a non-sharepoint page to add new items as well as update them. When I add a new record, all is fine excep that the hyperlink is displayed as the anchor text, not the "link". So <a href="">Google</a> gets shown as plain text,not a link with "Google" displayed. If I manually edit the list item with EditForm.aspx, it displays properly. Retrieving the list item using GetListItems gives me the correct anchor html. I have looked at the post via fiddler and everything seems in order. The one thing I haven't tried is to setup the CAML instead of using value pairs so that I can set the type= in the update. I am unclear whether my request is specified correctly or if some escaping is required. A correctly formated field should yield a link in the DispForm.aspx.

correct format Image

not so correct Image

I have tried the action below with 1) plain url, 2) html anchor, 3)url, url description, 4) urlEncoded... What am I missing here?
<soap:Envelope xmlns:xsi='' xmlns:xsd='' xmlns:soap=''><soap:Body><UpdateListItems xmlns=''>
<listName>Purchase Characterization</listName>
<updates><Batch OnError='Continue'>
<Method ID='1' Cmd='New'>
<Field Name='ContentType'>CharacterizeServers</Field>
<Field Name='parentRqID'>1234</Field>
<Field Name='Title'>XXXTitleXXXRequest ID:1234/Test - Do not process</Field>
<Field Name='RequestLink'>http://teams8xxxxRequest/DispForm.aspx?ID=1234</Field>
Feb 19, 2013 at 4:12 PM
Edited Feb 19, 2013 at 4:12 PM
I think if you change this line:
<Field Name='RequestLink'>http://teams8xxxxRequest/DispForm.aspx?ID=1234</Field>
to something like this:
<Field Name='RequestLink'>http://teams8xxxxRequest/DispForm.aspx?ID=1234, Display Text</Field>
it'll work as expected.

Feb 19, 2013 at 9:28 PM
Thanks for the suggestion. I tried this on a test list and was unsuccessful. Here is the POST:
<soap:Envelope xmlns:xsi="" xmlns:xsd="" xmlns:soap="">
<UpdateListItems xmlns="">
    <Batch OnError="Continue">
    <Method ID="1" Cmd="New">
        <Field Name="Title">Test websvc add</Field>
        <Field Name="linky">,Google</Field>
The response was
<UpdateListItemsResponse xmlns="">
            <Result ID="1,New">
                <ErrorText>Cannot complete this action. Please try again.</ErrorText>
Removing the ",Google" from the update request allows the function to complete successfully. However, it still displays as text, not a link.

Feb 19, 2013 at 9:39 PM

I just ran this in the IE Developer Tools interactively on a generic Links list and it worked:
        operation: "UpdateListItems",
        async: false,
        batchCmd: "New",
        listName: "Links",
        valuepairs: [["URL", ", Google"]],
        completefunc: function(xData, Status) {
Maybe there's something we're not seeing because you haven't posted your code?

Feb 19, 2013 at 9:53 PM
Marc, thanks for jumping in. Here is what I am using for a test case. I don't see anything different other than a space after the comma. After testing I found that the space is REQUIRED for this call to work correctly... Mystery solved.
        var values = [
            ["Title", "Test websvc add"],
            ["linky", ",Google"]

            operation: "UpdateListItems",
            async: false,
            batchCmd: "New",
            listName: "{34F5F005-0B18-4D48-BCE4-6293D5A523F6}",
            valuepairs: values,
            completefunc: newEntryCompletion
Feb 19, 2013 at 10:16 PM
Yup, I just caused the same error you were getting by removing the space.

Sometimes it's the little things...

Jun 19, 2013 at 1:46 PM
Thanks again Marc, Having a space proper in link & description part worked for me
Apr 23, 2014 at 8:52 PM
Hi RocklinBillbr,

I just came accross this library today and seems very promising.

I need an icon on the top ribbon bar that, when the user clicks on it, the current URL of the page is saved to a list of links (My Links list), and looks like you have done that already.

Can you please give me a quick step guide on how to implement that? The icon is on the master page. I am using SharePoint 2010.


Marco Garibay
Apr 23, 2014 at 9:27 PM


It has been a couple of years since I was working with SharepointServices. I assume you are wanting to use client side tools to make this happen? If so you can research the sharepoint client-side object for both .net and javascript.


Apr 23, 2014 at 9:30 PM
RocklinBillbr wrote:
Marco, It has been a couple of years since I was working with SharepointServices. I assume you are wanting to use client side tools to make this happen? If so you can research the sharepoint client-side object for both .net and javascript. Bill

Yes, thanks. So you don't recommend the SharePointServices library anymore?

Apr 24, 2014 at 2:28 PM


I do highly recommend it. My job currently doesn’t involve SharePoint at all. In my previous position I wrote 50,000+ lines of javascript utilizing SPS to build a custom application that is still in use. In our company IT locks down most of the development features of SharePoint, so I utilized Marc’s library extensively. Using the library allowed me to make the SP forms very dynamic based on business rules.