Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Although the solution seems relatively strightforward it doesnt seem to work.

Here is my CAML query to pull all items from a list that have been approved through the OOTB Sharepoint Approval Workflow.

I have named the workflow "Approval", but when I build the queries in U2UCAML Query Builder or CAML Designer they seem to display "Announce" in place of "Approval"....weird. I tried replacing it with Approval and executing it but it dint fly.

Please advise.

<Query>
<Where>
  <Eq>
     <FieldRef Name='Announce' />
     <Value Type='WorkflowStatus'>Approved</Value>
  </Eq>
</Where>
</Query>

enter image description here

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Instead of using U2U CAML Query Builder in a lot of cases it's easier to build the query by creating a view using the SharePoint UI. When you get the view right the use SharePoint Manager to look at the Query of the View.

In case of the status of the Approval workflow it may be a little complicated as what you want to check for isn't the text Appoved, but the status value of 16

So you query ends up something like:

<Where>
  <Eq>
    <FieldRef Name="Approval" />
    <Value Type="WorkflowStatus">16</Value>
  </Eq>
</Where>
share|improve this answer
    
"16" worked great! Is there an official Microsoft site I can find these mappings? For example what I would use in place of "In Progress"? Thanks! –  user7400 Jun 20 '12 at 14:36
    
I haven't found an "official" list, but have you see the link at "16" in my answer? –  Per Jakobsen Jun 20 '12 at 17:02
    
oops! I am sorry I dint notice the link in all the excitement. Thanks again –  user7400 Jun 20 '12 at 18:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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