I created a SharePoint designer workflow with name GraphicsWF. I want to get only the approved items, for that am using the query below

<Where><Eq><FieldRef Name="GraphicsWF" /><Value Type="WorkflowStatus">16</Value></Eq></Where>

I am not getting the values back as expected

  • 1
    <Where><Eq><FieldRef Name="GraphicsWF" /><Value Type="WorkflowStatus">16</Value></Eq></Where> – Bharathi Sep 22 '14 at 5:11
  • You want only approved item from the list? – Aanchal Sep 22 '14 at 5:13
<Query><Where><Eq><FieldRef Name="WorkflowColumnName" /><Value Type="WorkflowStatus">16</Value></Eq></Where></Query>

Here is the list of the status codes used to maintain the workflow statuses.

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
Approved                   16
Rejected                   17

Can you please post your complete code ?

  • @bhrati is the asker of the question. So I think he has tried that query with no success – Robert Lindgren Sep 22 '14 at 6:06
  • Corrected my statement :) – Manu Singh Sep 22 '14 at 6:09
  • <Where><Eq><FieldRef Name="GraphicsWF" /><Value Type="WorkflowStatus">16</Value></Eq></Where><OrderBy><FieldRef Name="Created" Ascending="FALSE" /></OrderBy> this is the query i have to pass so that it cna pick only the approved items – Bharathi Sep 22 '14 at 6:28
  • Are you using C# code or Client object model ? – Manu Singh Sep 22 '14 at 6:36
  • client object model to get the status of the itemwhere that list is having the designer workflow with associated task list – Bharathi Sep 22 '14 at 7:02

I know this is an old question but it seems to appear on the first page of various search engine results. I do not think the information on the other answers is accurate, at least not according to Microsoft documentation. Please see the link


On it, the status values are

  • 0 = Not Started
  • 1 = Started
  • 2 = Suspended
  • 3 = Canceling
  • 4 = Canceled
  • 5 = Terminated
  • 6 = Completed
  • 7 = NotSpecified
  • 8 = Invalid

Now, there is a UserStatus field that the developer can control but that can literally be a different set of values for every workflow if I'm not mistaken. Hopefully this will help someone in the future who has trouble finding the MS documentation straight away via a DuckDuckGo search!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.