SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

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


Posted 12-11-2006 6:35 PM by DavidWise

Comments

robertIreland wrote re: Howto: Filter a View based on Workflow Status
on 08-30-2007 11:00 AM

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.

DavidWise wrote re: Howto: Filter a View based on Workflow Status
on 10-04-2007 6:28 PM

Hey Robert,

The image is there now - hope that helps!

David wrote re: Howto: Filter a View based on Workflow Status
on 10-19-2007 10:01 AM

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

DavidWise wrote re: HowTo: Filter a View based on Workflow Status
on 12-19-2007 3:19 PM

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,

Manish MISTRY wrote re: HowTo: Filter a View based on Workflow Status
on 04-02-2008 1:43 AM

This can be really helpful!

Blog Technique de Romelard Fabrice wrote SharePoint : Créer une vue avec un filtre sur le statut d'un WorkFlow
on 05-13-2008 10:09 AM

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

Oliver Vogel wrote re: HowTo: Filter a View based on Workflow Status
on 07-01-2008 2:14 AM

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

Daniel wrote re: HowTo: Filter a View based on Workflow Status
on 07-08-2008 8:31 AM

Thank you,

just what i'm looking for.

DarkGod wrote re: HowTo: Filter a View based on Workflow Status
on 09-16-2008 8:36 AM

Great !!!

Thanks a lot

Mark wrote re: HowTo: Filter a View based on Workflow Status
on 09-24-2008 12:13 AM

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

You are the one true sharepoint God

bryan wrote re: HowTo: Filter a View based on Workflow Status
on 01-22-2009 2:28 PM

Thanks, I've been racking my brain on this one.

Rennick wrote re: HowTo: Filter a View based on Workflow Status
on 03-16-2009 4:10 AM

Saved my life. Hope my hair growns back now ...

wibby wrote re: HowTo: Filter a View based on Workflow Status
on 03-30-2009 4:52 AM

heh, i hacked around in the sharepoint designer to allow "WorkflowStatus contains 'Approved'" (which of course did not work) before I found this :D thank you so much!

Scott Rooke wrote re: HowTo: Filter a View based on Workflow Status
on 06-15-2009 1:12 PM

David -

Have you seen the value of 8 show up recently?  I can't seem to find out what 8 is = to.  Do you have any thoughts?

Thanks!

Scott

ASharepointGirl wrote re: HowTo: Filter a View based on Workflow Status
on 06-25-2009 10:31 AM

Awesome. Just what I was looking for.

Paul wrote re: HowTo: Filter a View based on Workflow Status
on 06-30-2009 1:45 PM

Thanks for posting this!  Saved me a lot of time.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.