Click here to Skip to main content
Click here to Skip to main content

Tagged as

Guide in developing Initiation Form on Sharepoint Workflows

, 3 Dec 2010
Rate this:
Please Sign up or sign in to vote.
Guide in developing Initiation Form on Sharepoint Workflows

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.

  1. Create an “Office Supplies” List:

  2. Now using Sharepoint Designer, go to your list and create a workflow.

  3. Name your workflow, I called it “Supply Request Workflow”

  4. Now Save and Publish your workflow and make sure it created a Task List and History List:

  5. Double check if you have the Task List by going to your Sharepoint instance:

  6. Now update that task list to cater to the following new fields: Item Requested, Quantity and Requested By.

  7. Back to Sharepoint Designer and edit your workflow again:

  8. Now create an Initiation Form by clicking the Initiation Form Parameters:

  9. 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.

  10. 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:

  11. Now choose the property “this list”.

  12. Now choose the “Association: Task List”:

  13. Modify the Value sent to those fields:

  14. For example, in the Title Field (“of the Task List”), you want to use the Current Item which is the “Office Supply List” Name.

  15. 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”.

  16. 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”.

  17. Once all values are properly assigned, click OK.

  18. Now Save and Publish again.

  19. 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”.

  20. Now name your button, I called it Request now. And set it to initiate your “Supply Request Workflow”.

  21. Add your icons. Then you are done.

  22. Open now a list item on “Office Supplies” list, then you will see your “Request Now” button. Click that.

  23. Now you see your “Supply Request Workflow” with the input forms you had defined.

  24. Click start to initiate the request, and you will see it on the “Task List”

  25. With the fields populated as configured.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Raymund Macaalay
Technical Lead
New Zealand New Zealand
http://nz.linkedin.com/in/macaalay
http://macaalay.com/
Follow on   Twitter   Google+   LinkedIn

Comments and Discussions

 
QuestionInitiation form Buttons PinmemberJohnathan Lightfoot16-Oct-12 3:47 
Hi,
Thank you so much for providing this really neat and handy post. I was able to follow your post and create a custom action button for a form that I have. It works and when I press the Start button it kicks off the workflow fine. The only issue I have is once the button is pressed the workflow kicks off but the dialogue box does not close. Is there something I am missing? Currently I have to press the small "X" in the corner of the dialogue box in order to get it to close.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140826.1 | Last Updated 3 Dec 2010
Article Copyright 2010 by Raymund Macaalay
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid