Tuesday, September 25, 2012

SharePoint Workflow Nintex Tips and Tricks

Nintex workflows come with a lot of built in actions which can be used in a straight forward way. You do need to be careful when using couple of actions like:
  1. Set Item Permission
  2. Call a Web Service

Using Set Item Permissions action

After you have configured your “Set Item Permissions” action your workflow will look something like the image below
How workflow looks after Set Permission action
This setup may work 100% in your perfect development environment, but we have seen this workflow fail in live environments. The error message in our case was “The workflow could not update the item, possibly because one or more columns for the item require a different type of information.” which isn’t of any help.
We fixed the error by adding a “Pause for” action. The action was configured to pause for 1 minute but the workflow may be paused for 5 minutes due to the workflow timer service interval, which is 5 minutes by default.
The updated workflow should look like this
New look of Workflow

Using Call a Call Web Service action

You may find yourself using SharePoint workflows when you want to update a list in a different site. This can be easily done with the help of “Call web service” action.
Your first instinct would be to pass the values directly to the web service call but this would be quite painful in the future. You will find that your workflow failing for some of the list items. An easier way to fix the errors caused by the web service action is to encode the values from the list item column to a variable and passing the variable to the web service action. This is done by using fn-XMLencode() function. This function encodes the character “&” to “&”. With the values encoded your workflow may still fail if the value itself has a comma. We can solve this issue by surrounding the values with “{TextStart}” and “{TextEnd}” tokens. Now the comma will be considered part of the text and will not interfere with your function.
The value in the “Set a variable” should look like this fn-XMLencode({TextStart}MyField{TextEnd}
 

Conclusion

The actions provided by Nintex can be used out of the box but requires tweaking after the workflow is running in the production environment. The tweaks are not obvious in development but it makes life easier when the workflow is pushed live.

No comments:

Post a Comment