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

Using SPServices inside a Workflow

Jun 29, 2011 at 4:21 AM

Hi Everyone,

First, I have tried to customized an aspx page and inserted the spservices library in the code of the page it worked without any huff, (displaying another list from the customized page was a pizza using the spservices library)

Now here's my problem, I have a workflow, inside a workflow is an aspx page, what I wanted to do is to automatically display the content (associated list content of the selected item) say im from a list and click edit, i would like to display all the fields subtracting the user to click a link to display the associated/all fields existing from a list item. The integration is done without any trouble but when I try to do the cycle, it seems not to work and churns out "Object doesn't support this method", is this an implication that spservices can't be used inside a workflow? or there are just some tweaks to do?



Jun 29, 2011 at 4:25 AM


It's not really clear what you're trying to do. SPServices itself can be used on any page, and the error you are getting may mean that your references to the jQuery and SPServices script files aren't valid.

Here's a blog post with some info on how to check:


Jun 29, 2011 at 5:39 AM
Edited Jun 29, 2011 at 5:40 AM

My apologies Marc, if I wasn't able to explain my question very clearly, please let me rectify and reiterate my question,

The link you gave was absolutely my first line of troubleshooting, its always a practice for me to alert just to make sure that the libary/ies are firing or are reference correctly. Anyway, thanks for the link it hardens my belief that its a good practice.

Going back to my issue, I have a workflow, (called Review Document), from the list (Review Items) I will click 1 item, say Project1:The StarWars Reunion, basically you will be redirected/transferred to a page where you have several menus like New Item, Edit Item, Delete Item so on so forth...

Now clicking Edit Item would redirect me to a page where it shows *some details* (as per design) and a link to display all the associated fields of the selected Item from the list, what I wanted to achieve is that instead of clicking the link, on page load I wanted to used the spservices library to display the associated (other fields) automatically.

I was able to display the alert(), unfortunately, when it enters into the $.SPSERVICES()... as I suspect, I would see an error notification,

I suppose it should work smoothly because I was able to do it before, hooking up from one of my list, i displayed the announcements together in one page using the spservices library, that's why it makes me wonder if it has something to do with the workflow, though its an aspx page also, i can't decipher...



Jun 29, 2011 at 6:25 AM

OK Marc, I made it through... thanks for the support *it does work anywhere the sharepoint site, the catch is that it should be residing on the SAME SITE (a list on the same site) also, I have relocated the js library together with spservices on the same site (I have created a folder within the site) though I think this is irrelevant because I was referring to a list external to my working site that makes it impossible to display the items from the list. One more thing, since we should refer to ows_ (ows:) what are the available reference field that I can extract from a list, or at least where is the XML that I should refer to?

I'm using

ID, Title and they are displayed as expected, for BODY it says undefined... how do i reference to those fields on the list...



Jun 29, 2011 at 10:39 AM


No need to bother everyone, I found out how to do it, when dealing with spaces you really need to use *exactly* the name and the spaces should be replace with _x0020_ eg.

Return Status would be ows_Return_x0020_Status,




Jun 29, 2011 at 11:21 AM

I can't believe that I will keep coming back here to bother everyone, just a question, using the spservices, can I find the ows_ value dynamically, I mean right now, to populate my client side html I do

ows_ID, ows_Title, ows_Return_x0020_Status etc.... what if I got 100 columns, thats a lot of work, what Im planning is to loop through the return response and get the value of what field? that is the question,

Its probably not the nodeName, am I right?


Hi Marc,

Where can I reference this question, I seem to see the powerful capabilities of your library, but I can't navigate that much because I am unaware of the fields and properties, if there is only one reference that I can read on...




Jun 29, 2011 at 12:38 PM

Lots of comments to wake up to!

The .js files can be stored anywhere accessible by the current user. Some people even use the Google or Microsoft CDNs. I'm not sure why you were having access problems, but I'd guess permissions.

All columns returned by the GetListItems operation will have their names preceded by "ows_". That's really it! The column names are the StaticName, not the DisplayName. See the Glossary (which is linked to throughout the docs) for further information.

You really need to use the MSDN SDK in tandem with the SPServices docs - also linked throughout. I don't "own" the Web Services, SPServices just makes them easier to work with.


Jun 30, 2011 at 3:32 AM

'Im not reading the documentation' *grins...

Anyway, since each field is prefixed with "ows" and we already the know the column names, which part of the xData.responseXML holds the static Name?, I need to dynamically create the html using the column names, as I pointed out having 100 columns it a tedious job for a lazy programmer like me *grins,

$(xData.responseXML).find("[nodeName='z:row']").each(function() {
      	var curItem=$(this).attr("ows_ID");
        var liHtml = "<li>" + $(this).attr("ows_Title")+" - "+$(this).attr("ows_ID") + "</li>";

As you can see the column names are hardcoded, ows_Title, ows_ID, does it have something to do with the nodeName? 
I wish to see the content of xData.responseXML (trying to alert but all I get is [Object object])


Jun 30, 2011 at 3:56 AM

To alert the xml, try 


as for your other question, you could run a GetList operation, store all of the StaticNames and then iterate through them.  I doubt you are going to like those results though b/c there are many hidden columns that will be returned with that operation.  Are they useful???  That's a debatable topic.

Jun 30, 2011 at 5:40 PM

I'm with Matt. I'm not sure what the benefit of simply looping through all of the item's columns is. You can grab the values you actually need by specifying their column name in "ows_" + StaticName format.