2

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

1 Answer 1

2

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>
3
  • "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
    Commented Jun 20, 2012 at 14:36
  • I haven't found an "official" list, but have you see the link at "16" in my answer? Commented Jun 20, 2012 at 17:02
  • oops! I am sorry I dint notice the link in all the excitement. Thanks again
    – user7400
    Commented Jun 20, 2012 at 18:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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