Posts Tagged ‘SharePoint Designer 2010’

Create Item Workflow – SharePoint Designer 2010

May 30th, 2010 Comments off

Sometime you have to create a new list item in a different list on the list item changed or list item created events. It can be to create an announcement on a list item created or changed. In these cases you also like to use the originator list item properties in new list item.
In order to create this workflow using SharePoint Designer 2010 we will use the same approach as in my previous blog. We just do changes in the workflow Action. So create a new workflow CreateItems in SharePoint Designer 2010. You can find more help on creating workflows using SharePoint Designer 2010 here.

For this demonstration I will create a workflow which creates an item in a list name ParentList on item created and item changed of Announcements list. For this I created three new fields in custom list ParentList. These columns names are listName, ItemGuid and ItemTitle. All these are single line fields. And we will assign values in these columns through workflow.
Open Action in the top ribbon of the workflow setting screen in SharePoint Designer 2010. Select Create List Item option. It will create a standard statement for Create List Item Action. Now click on this list and select ParentList.
Click on the ListName in fields and select modify. Add value Announcements as list name. Then add a new field for column ListItem. For value select the function button (fx) and then select the Current Item in Data source and select the GUID in Field from source. Click Ok finally.

Add another field for ItemTitle column and select the Current Item and Title instaed of GUID.

It will actually tell workflow to assign these values to newly created item. In this case it is assigning the Announcements list item GUID and title to new item. Also we added Announcements as a text for ListName here.

Now save the workflow and then from workflows setting screen change the Start Options. Select the list item created and list item changed there. After doing all these settings just publsih it.

Once this workflow is deployed on the site, open the site and add new item in Announcements list. It will create a new item in ParentList and assign Announcements list item GUID and title to the specified fields of newly created ParentList item.

Isn’t this very simple and cool

Have fun.

Copy Item Workflow using SharePoint Designer 2010

May 30th, 2010 15 comments

SharePoint Designer 2010 comes with huge improvements in its features. One of the very amazing improvements is designer’s workflows.

Today I’m going to create a list item workflow in SharePoint Designer 2010. This is a simple workflow that you create in several cases. For this demonstration I have created a TeamSite. You can create this workflow for any site.

What we will achieve from this workflow

I have a default announcement list. And then I created another list with the name CopiedAnnouncement with announcement list template. Now I want to create a workflow for announcement list so when I create or change an item in announcement list it will copy the item in CopiedAnnouncement list. Both the lists are identical in structure.

Also I edited my site’s home page to display both lists. For this
Click on Edit Page under Site Actions
Click on Insert under Editing Tools
Select Existing List
Select Announcements and CopiedAnnouncements one by one.

Purpose of displaying lists on the same page is just to see workflows result quickly.

Now come to the main task, and open your site in SharePoint Designer 2010. In order to create a new workflow, click on File menu and select Add Item. Then select the List Workflow under Workflows tab.

Add CopyItem as the name of new workflow. And select the Announcements in the list drop down. Your new workflow will be attached to the selected list.

When ypu click on Create, it will show a popup message to download data for workflow.

Once it completes the downlaod and load the workflow page. Then click on Edit Workflow link.

Now on this screen you can add Conditions and Actions for your workflow. My workflow is very simple and not using any condition so I will just add as Action straight away. Click on the Action from the top ribbon and then select the Copy List Item.

It will create a standard Copy List item Action.

Now select the Current Item for first option and select CopiedAnnouncements for second option. It is pretty straight forward that this action is saying to copy the current list item to selected list.

Now Click on the Save, it will show a save progress message.

Now choose the Start Option. There are three options to trigger a workflow. Start manually, on List Item Created and on List Item Changed. In my case I selected for List item Created. You can find these options under Start Options on the main workflow setting screen.

Now click on the Publish from the top ribbon. This will deploy the workflow on the site and also attached it to the already selected list. Making life easy. When your workflow is deployed, you can verify it by looking into the list workflow setting. CopyItem should be visible there and will show 0 numbers of workflows running at this stage.

Now it is the time to see workflow in action. In order to test the workflow add new item in announcements list. When we add a new item in list it will trigger the workflow to copy the item in CopiedAnnonucements list.

After adding new item in the Announcements list, you just have to refresh the page. Give 5 to 10 seconds to workflows to trigger and then refresh the page. You can see the item copied it the CopiedAnnonucements list.

Thats All, your workflow is ready and working what was expected.