SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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 created a form that start a workflow automatically when an item is created, and I redirect to html page that shows a message like "Processing... please wait.", and I wait 3 seconds and so redirect to a page with results of the workflow.

Instead of wait 3 seconds, I want to create a javascript that check if the workflow is completed, then redirect to results page.

I am using SharePoint 2010 Foundation

Is there way?

share|improve this question
Please add the version of SharePoint (2007,2010,2013) as a tag to your question. – Vardhaman Deshpande Jul 17 '13 at 19:37
@VardhamanDeshpande ok. I added the tags. It is SharePoint 2010 Foundation. – Guilherme J Santos Jul 17 '13 at 19:39
up vote 5 down vote accepted

I haven't tried this method, but I think it should work. If you use the Lists web service to query for the particular item, you should be able to retrieve the workflow status column and see it's value. It should give you In Progress/Complete. In your code, you'd just need to check that status and wait/recheck in a few seconds or redirect to your page based on the results.

Edit: I tried using SPServices and it does work:

    operation: "GetListItems",
    async: false,
    CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='WFColumn' /></ViewFields>",
    listName: "MyList",
    completefunc: function (xData, Status) {
        $(xData.responseXML).SPFilterNode("z:row").each(function() {
            if ($(this).attr("ows_WFCol" === 5)){
                console.log("It's complete");
share|improve this answer
worked like a charm! I love SPServices! How I lived all this time without it???? Thanks! – Guilherme J Santos Jul 19 '13 at 15:26

You can use the Dom/debug in the browser(press F12) then find the 'name =" "' atribute of the column. Then use that name with Spservcies. For my example I trigger my wf by updating a column then returning a workflow status colmn value:

 function CopyStrategyDocuments(StrategyDocID, StrategyDocLocation){

                                        operation: 'UpdateListItems',
                                        listName: 'Case Attachments',
                                        ID: StrategyDocID,
                                        valuepairs: [['Copy_x002d_Document','Yes'],['Copy_x002d_To',StrategyDocLocation]],
                                                                        completefunc: function(xData, Status) {

                                              var test = $(xData.responseXML).SPFilterNode("z:row").attr("ows_CopyDocu");



enter image description here

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.