Have you ever wondered what's the use of Initiation Forms on Sharepoint? Have you ever thought of creating a list item based on an item on another list? Do you want to extend the 2 buttons in Manual Workflow Initiation to have input forms? Well that’s the use of the Initiation Forms and I will run you though a sample that will work for you.
So what is an Initiation form? It's simply a page that is presented when you start a workflow manually, the page where you see two buttons for “Start” and “Cancel”. By default, you have those buttons but you can extend this page by adding form fields and use the value on those as variables that you can consume for your workflow process.
So let's start with a sample, let's say you have the requirement to have an Office Supply list where your team can place an order on a specific item and that invokes a workflow on the back, making a task list grabbing important details like Name of requester, quantity and the Item requested. Here are the steps to achieve it.
- Create an “Office Supplies” List:
- Now using Sharepoint Designer, go to your list and create a workflow.
- Name your workflow, I called it “Supply Request Workflow”
- Now Save and Publish your workflow and make sure it created a Task List and History List:
- Double check if you have the Task List by going to your Sharepoint instance:
- Now update that task list to cater to the following new fields: Item Requested, Quantity and Requested By.
- Back to Sharepoint Designer and edit your workflow again:
- Now create an Initiation Form by clicking the Initiation Form Parameters:
- Now add the field, this is the field that will populate your Task List as well on step 6, so create the same fields and its format you have on the said step.
- Once done, it is time for you to set up an Action on Step 1, and we need to create a “Create List Item” action:
- Now choose the property “this list”.
- Now choose the “Association: Task List”:
- Modify the Value sent to those fields:
- For example, in the Title Field (“of the Task List”), you want to use the Current Item which is the “Office Supply List” Name.
- You can add more
strings of your choice if you want, so since this is a new request we make the title “New Item Requested : Your Item”.
- Now for other fields like
Quantity, you can grab it from the initiation form you created in Step 8. To do that, just choose “Workflow Variables and Parameters” in Data Source and you will see the fields you created on the “Field from source”.
- Once all values are properly assigned, click OK.
- Now Save and Publish again.
- Now usually manual initiation workflow starts by hitting the Workflows Button, then choosing the appropriate workflow to run. To make it a bit user-friendly, I guess we will have to create a button on the Display Form Ribbon of an item. Do that by clicking Custom Action and choose “Display Form Ribbon”.
- Now name your button, I called it Request now. And set it to initiate your “Supply Request Workflow”.
- Add your icons. Then you are done.
- Open now a list item on “Office Supplies” list, then you will see your “Request Now” button. Click that.
- Now you see your “Supply Request Workflow” with the input forms you had defined.
- Click start to initiate the request, and you will see it on the “Task List”
- With the fields populated as configured.