Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provided better example of item parameter value #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/core/web-services/Workflow/StartWorkflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,26 @@ $().SPServices({
```javascript
workflowParameters: "<Data><Parameter1>" + parameter1 + "</Parameter1><Parameter2>" + parameter2 + "</Parameter2></Data>"
```


Here's a complete example from [dsMagic12](https://github.com/dsmagic12) which shows to start a workflow given a know list item ID number, the title of the list the item is in, and the GUID of the workflow you wish to execute (assumes you do not need to pass any parameter values):

```javascript
var listURLName = "Tasks";
var itemId = 1;
var workflowGuid = "{01116f76-e2c2-4a1a-b099-9b82680c14e8}";
jQuery().SPServices({
async: true,
debug: true,
operation: "StartWorkflow",
item: jQuery().SPServices.SPGetCurrentSite() +"/Lists/"+ listURLName +"/"+ itemId +"_.000",
templateId: workflowGuid,
workflowParameters: "<root />",
completefunc: function(xDataStartWorkflow, StatusStartWorkflow) {
try{console.log("Started workflow on item |"+ itemId +"|");}catch(er){}
try{console.log(xDataStartWorkflow);}catch(er){}
try{console.log(StatusStartWorkflow);}catch(er){}
}
});
```