Tags: , , | Categories: How-To Posted by Spyros Moschovakos on 4/29/2011 7:04 PM | Comments (0)

BPC PowerForms can be easily used as a means of data collection during a Sharepoint Workflow step, since they bind to any possible content type. Let’s create a simple approval Workflow in Sharepoint Designer 2007 to see this process (we will not go deep on how to construct an SPD based workflow, just make dummy one in order to demonstrate the integration with PowerForms):

1) Open your site in SPD, and choose “File/New/Sharepoint Content/Workflow”

Press OK .

2) Assuming that there is a list named “PF Registrations”, we will now set this workflow to run upon creation of each “Registration” record in the list.


Press “Next”.

3) Now, add a new “Collect Data from User” Action 

Click “this user” to select the user who is going to approve the registration, and then define the form fields by clicking on “Data”. We can now create a new task (this is essentially the sharepoint content type within the Task list), and press next to define our fields:

We will also add a “Comments” field (multiple lines of text) and conclude our workflow design:


4) Once we press finish, a brand new content type has been created behind the scenes, which inherits from “Task” and is added into our Task List. In order to change the default page that sharepoint creates and enrich it with PowerForms, we will navigate to  [Site]/Workflows/[Workflow Title]/[Task Content Type Name] and edit the [Content Type Name].aspx page. In our case we will need to modify /Workflows/PowerForms Approval/PowerForms Approval Task.aspx 



5) If we open this file with Sharepoint Designer, we will see a custom web part that has been auto-created. Since we don’t need this, we can freely delete the entire data form web part (select the DataFormWebPart and click Edit/Delete):

6) After the deletion, click somewhere inside PlaceHolderMain, and click Insert/Sharepoint Controls/Web Part from the top menu. You will then see a list of available web parts. Assuming that you have already installed BPC PowerForms, drag and drop "BPC PowerForms Web Part" into the placeholder. Then, right click and select “Web Part Properties” in order to provide the target list, as shown below:


Expand “Binding Details” and insert the Sharepoint task list that your workflow is using. In our case, the list is “Tasks”.


Important: Do not confuse the Task list with the source list that triggered the workflow (in our case “PF Registrations”). When the user is asked to provide data during a workflow execution,   they essentially fill-up a record in the Tasks list.


7) We are now ready to run our workflow. Our registration list is ready and configured with the desired PowerForms design (you don’t have to activate PowerForms in the source list, it is completely irrelevant with our workflow forms), so now let’s add a record in our PF Registration list. 


The workflow instance is started, and a task has been generated:

8) In order to customize the form, we should click “Edit” on the task and press “Design Form” once the PowerForm appears. Initially the form comes with all task fields visible. Obviously we need to remove (or make readonly) the extra fields we do not wish to appear. The rest of the configuration is exactly as you know it in a plain list/document library (see PowerForms Knowledge Base for further info/tutorials). In our case, I am going to leave only the “Registration Approval” and “Comments” fields, and keep a couple of read only fields for displaying Workflow-related info:

Manipulating workflow data collection tasks through PowerForms gives us the ability of providing extra functionality/business logic on the form during the flow execution. Let’s assume in our example, that we want the user to be able to add some comments, only in case “Please elaborate” is selected. We would then open the form in design mode, select the comments control (c_comments) and in “Advanced” tab, we would place the following expression in the "enabled formula" field:  

FieldValue("c_Registration_x0020_Approval")="Please elaborate"

9) Our PowerForm is ready to be used within a sharepoint designer workflow context now. Every time a task of this content type is created, sharepoint will know that the form is going to be rendered with our BPC PowerForms web part, loading the design/layout customizations we performed in step 8.  If we fillout the form and press “Save and Exit”, our workflow gets “Completed”. We can then see the values filled if we click the “Completed” link in our “PF Registrations” respective record, and click on the task name:

Hopefully this tutorial will assist you in implementing much more complex scenarios when it comes to data request operations during a Sharepoint Workflow. Enjoy!

Add comment

  Country flag
  • Comment
  • Preview