in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

David Wise's Sharepoint blog

HowTo: Filter a View based on Workflow Status

One of the known issues with SharePoint 2007 is the inability/quirkiness of filtering a view based on the status of a workflow field.  While this is a pain, there is an easy workaround.  Simply create the filter and tell it to look for the integer representation of the status value you are looking for, like this:

This will create a filter that returns all "Approved" items.  The codes are:

  Status Value  
  Not Started 0  
  Failed on Start 1  
  In Progress 2  
  Error Occurred 3  
  Canceled 4  
  Completed 5  
  Failed on Start (retrying) 6  
  Error Occurred (retrying) 7  
  Canceled 15 * This is defined but I don't think this value is used
  Approved 16  
  Rejected 17  

 

12/19/2007 Update:  Filled in list of values using the actual values found in the field definition itself.

5/28/2008 Update:  Hit by a flash of the blindingly obvious.  If you put the status fields on a view, then view that in the Datasheet mode, it shows you the integer values.  I don't know why I hadn't seen this before ....

Published Dec 11 2006, 06:35 PM by DavidWise
Filed under:

Comments

 

robertIreland said:

Any chance of sending the missing photo. I'm having real problems filtering a list based on the Workflow Status of the items in the list. Any help greatly appreciated.

August 30, 2007 11:00 AM
 

DavidWise said:

Hey Robert,

The image is there now - hope that helps!

October 4, 2007 6:28 PM
 

David said:

Microsoft certainly didn't make it easy to filter a list based on Workflow Status :-(

another couple of magic numbers for your list

Status   Value

Complete  5

Cancelled 15

October 19, 2007 10:01 AM
 

DavidWise said:

David,

Updated as I was able to correlate those to the actual values in the list.  I'm not sure why Microsoft defines both 4 and 15 as "Canceled" but that is how it appears in the underlying field definition.

Thanks,

December 19, 2007 3:19 PM
 

Manish MISTRY said:

This can be really helpful!

April 2, 2008 1:43 AM
 

Blog Technique de Romelard Fabrice said:

Lorsque l'on développe des WorkFlow, une demande apparaît très rapidement sur l'affichage des données

May 13, 2008 10:09 AM
 

Oliver Vogel said:

Hi David,

I am using a multi-stage approval workflow to route a form around several approvers, is there any way to filter the view based on which reviewer is currently responsible for approving the document?

Thanks

Oliver

July 1, 2008 2:14 AM
 

Daniel said:

Thank you,

just what i'm looking for.

July 8, 2008 8:31 AM
 

DarkGod said:

Great !!!

Thanks a lot

September 16, 2008 8:36 AM
 

Mark said:

There are no words to describe how #$%^&&* grateful I am to you for this information.

You are the one true sharepoint God

September 24, 2008 12:13 AM

Leave a Comment

(required )  
(optional )
(required )  
Add

About DavidWise

I have been writing software for over 16 years and web applications for 11 years. I have been also been elbow deep in SharePoint 2007 since Beta 2 and loving it! Currently, I work for Bennett Adelson Consulting (a Microsoft Gold Partner) based in Cleveland, Ohio.

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts