Azure, Open Source, SharePoint and ...

Using different InfoPath forms for tasks in your custom workflow

When using InfoPath to design task forms we can easily use different forms for tasks being created by Workflow instance, all you have to do is to extend the workflow.xml setting by adding additional <Taskx_FormURN> child elements under <MetaData> element (where “x” is a zero based index) and setting the SPWorkflowTaskProperties.TaskType to index value.

For example, lets say we want to have different forms for Approval and Verification tasks in our workflow:

Add a seperate element for each IP form to Workflow.xml:


In your code set the SPWorkflowTaskProperties.TaskType to either 0 or 1 when creating the tasks depends on whether it is an Approval or Verification task.