Friday, February 19, 2010

Nintex SharePointTaskId, InfoPath, and conditional formatting

I was recently working on an InfoPath form that was used to drive a Nintex workflow. I had gotten to the point where I needed to make sure not just any ole user could respond to a task as terrible things happened (the rules in the InfoPath form were applied, but the workflow would not move forward and chaos ensued).

My search began with the SharePointTaskId property in the GetRunningWorkflowTasksForCurrentUser web service method that Nintex provides. I noticed some oddities in the process:

1) in code, the value was always empty. just to make sure I wasn't hallucinating I copied the outerxml of my xpath query. every node in the subtree had an empty value. YET, if I applied conditional formatting by saying "is not blank", it worked.

2) if I tried to perform conditional formatting by saying where SharePointTaskId is blank, it did not work. This had me scratching my head since the "is not blank" worked perfectly.

My solution for the second issue was to compare the WorkflowName property against a pattern (e.g. WorkflowName does not match pattern \p{L}+ -- in other words, WorkflowName has to have at least 1 letter)

2 comments:

Vadim Tabakman said...

Great idea to use that regular expression. I'll have to keep that one in mind.

Nicely done Robin :)

Mehul K Bhuva said...

I develop workflow applications on Nintex and InfoPath almost everyday and I use the GetRunningWorkflowTasksForCurrentUser webservice,when a user open the browser enabled InfoPath form, to whom the task has been assigned, the SharePointTaskId does not return blank, I have Form Load Rules, where I keep a simple condition: SharePointTaskId is not blank

and it works like a charm. Make sure you first drag and drop your secondary data source: i.e. GetRunningWorkflowTasksForCurrentUser in the InfoPath form as a table and then debug and check.

Secondly check your Nintex workflow options, where your tasks are getting created, in Tasks list or Workflow Tasks list (in case of Publishing sites).

I have written a 2 part series on InfoPath and Nintex workflows,

Part 1 covers step-by-step tutorial on Integrating InfoPath forms with Nintex workflows via Nintex OOTB web services.

Check it out: http://www.sharepointfix.com/2009/10/infopath-2007-form-and-nintex-workflows.html

Part 2 covers step-by-step tutorial on Deployment of browser enabled InfoPath forms as Content Types using the SharePoint feature framework.

Check it out: http://www.sharepointfix.com/2009/12/infopath-2007-form-and-nintex-workflows.html

Do drop in your comments, in case you find the information valuable