GetTemplatesForItem

Function

$().SPServices

Web Service

Workflow

Operation

GetTemplatesForItem

Example

Here's an example provided by nrahlstr. Thanks, Nathan!

var workflowGUID = null;
$().SPServices({
  operation: "GetTemplatesForItem",
  item: itemURL,
  async: false,
  completefunc: function (xData, Status) {
    $(xData.responseXML).find("WorkflowTemplates > WorkflowTemplate").each(function(i,e) {
      // hard coded workflow name
      if ( $(this).attr("Name") == "Workflow Name" ) {              
        var guid = $(this).find("WorkflowTemplateIdSet").attr("TemplateId");        
        if ( guid != null ) {
          workflowGUID = "{" + guid + "}";
          }
        }
      });
  }
});

Back to top