Workflow to automatically approve my comments

Body:

As you can imagine, a top-notch web site like mine gets a lot of traffic. Sometimes those people leave me comments. Usually to tell me I’ve typoed the name of a Netcast, or that I’m flat out wrong about something. The important thing is that they care enough to leave comments. There is another, darker, evil group of people that leave comments on my blog. Spammers. We hate them. To discourage spammers from leaving comments on my blog I’ve taken two steps. First, I require a valid date to be entered for a comment to go through. Second, I require each comment be lovingly approved by yours truly before it shows up. That way if a spam comment sneaks through I can delete it before it shows up. It also gives me the opportunity to edit out any unflattering things that might accidently get submitted. Together I think these do a pretty good job of keeping the riff-raff out. There is one downside to all these hoops, when I submit my own comments in reply to other comments I have to approve them too. If only there was a way for SharePoint to know that any comment posted by me was pure gold and should be approved automatically. Oh wait, there is…

Oddly enough, laziness is a great motivator. My hatred for approving my own comments forced me outside of my comfortable IT Pro box and into the scary realm of end userdom. I decided that a workflow was the easiest way to accomplish this. First, let’s identify the enemy:

SNAGHTMLc752a5

That’s just unacceptable. The first step to my remedy is to fire up SharePoint Designer and open up my site and then open the Comments list.

image

After your list is open, go to the lower right corner to the Workflows section and click New:

image

I called the workflow “Auto approve TK’s comments.” I recommend you do the same.

SNAGHTMLcc2fba

After the workflow is created, you need to add a condition for the workflow. This is how it figures out whether to act or not. Since this workflow needs to determine if I’m the one submitting the comment, the condition I used is “Created by a specific person.”

image

After the condition is created we need to define it. Click “specific person” and either type the username in, or pick it from the list:

image

I pick…me!

SNAGHTMLd362cb

Next we need to assign and action to our condition. The action I used was “Set Content Approval Status.”

image

After the action was added, I clicked “this status” and selected “Approved.”

image

image

It may seem like that’s all we need to do, but there’s a couple more very important steps. First, we need to tell SharePoint to run this workflow automatically when a new item is created. In this case when a new comment is added. Go back to the workflow’s settings page and click “Start workflow automatically when an item is created.”

image

The final step is to save and publish the workflow to our list:

image

That’s all there is to it.

Now when I submit a comment to my blog the workflow runs and automatically approves it. No more of that pesky clicking for me.

image

Hope someone can make use of this.

tk

Category: SharePoint 2010
Published: 12/23/2010 10:29 PM
Attachments: http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_10_51868441.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_12_51868441.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_14_51868441.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_16_51868441.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_18_51868441.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_2_667806B4.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_20_51868441.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_4_667806B4.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_6_667806B4.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_8_667806B4.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_thumb_1_667806B4.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_thumb_2_667806B4.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_thumb_3_667806B4.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_thumb_4_51868441.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_thumb_5_51868441.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_thumb_6_51868441.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_thumb_667806B4.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_thumb_7_51868441.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_thumb_8_51868441.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/image_thumb_9_51868441.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/SNAGHTMLc752a5_667806B4.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/SNAGHTMLc752a5_thumb_667806B4.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/SNAGHTMLcc2fba_667806B4.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/SNAGHTMLcc2fba_thumb_667806B4.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/SNAGHTMLd362cb_667806B4.png
http://www.toddklindt.com/blog/Lists/Posts/Attachments/247/SNAGHTMLd362cb_thumb_51868441.png

Read the complete post at http://www.toddklindt.com/blog/Lists/Posts/ViewPost.aspx?ID=247


Posted Dec 23 2010, 10:29 PM by Todd Klindt's SharePoint Admin Blog: Posts
Filed under:
Idera SharePoint Reviews SMBology, Inc. Rackspace Hosting Sponsored by Idera and SharePoint Reviews and SMBology and EPCGroup.net
Copyright 2011 SecretsOfSharePoint.com. All rights reserved.