Get Items by Query

by jlavia » Fri Jun 17, 2016 8:51 pm

I am using the Get Items by Query action on 3 lists in 3 separate sub-sites. 2 are working fine but the 3rd returns "Garbage".
CALM Query.GIF
CALM Query
CALM Query.GIF (6.36 KiB) Viewed 517 times

I have tried returning different fields and all come back with the same "garbage". The returned value looks like a small rectangle.
Result.GIF
Result
Result.GIF (7.01 KiB) Viewed 517 times

Has anyone sen anything like this before? Any help would be greatly appreciated.
jlavia
 
Posts: 8
Joined: Wed Apr 27, 2016 11:33 am

by feganmeister » Mon Jun 20, 2016 8:23 am

Hi @jlavia,

I always type out my CAML into an application that will format and have syntax highlighting (such as Notepad++). I copied out your CAML and it seems you have terminated the FieldRef tag before the Value rather than wrapping the value in the FieldRef tag. Here's your CAML;

Code: Select all
<View Scope="RecursiveAll">
  <Query>
    <Where>
      <And>
        <Eq>
          <FieldRef Name="Title" />
            <Value Type="Text">[%Current Item:Work Order%]</Value>
        </Eq>
        <Eq>
          <FieldRef Name="Selected_For_Purchase" />
            <Value Type="Boolean">1</Value>
        </Eq>
      </And>
    </Where>
  </Query>
  <ViewFields>
    <FieldRef Name="ID" />
  </ViewFields>
</View>


I think it should probably look more like this:

Code: Select all
<View Scope="RecursiveAll">
  <Query>
    <Where>
      <And>
        <Eq>
          <FieldRef Name="Title">
            <Value Type="Text">[%Current Item:Work Order%]</Value>
          </FieldRef>
        </Eq>
        <Eq>
          <FieldRef Name="Selected_For_Purchase">
            <Value Type="Boolean">1</Value>
          </FieldRef>
        </Eq>
      </And>
    </Where>
  </Query>
  <ViewFields>
    <FieldRef Name="ID" />
  </ViewFields>
</View>


Hope that helps.
User avatar
feganmeister
 
Posts: 13
Joined: Tue Feb 09, 2016 11:07 am

by jlavia » Wed Jul 13, 2016 12:18 pm

That was a big help! Thanks a bunch!
jlavia
 
Posts: 8
Joined: Wed Apr 27, 2016 11:33 am


Return to Workflow Actions Pack for Office 365

cron