cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Quering empty subfolders with Office 365 query list action

I'm trying to use the office 365 query list item to see if a subfolder is empty or not.

When I make a query trough the query builder it looks like the query only see's documents and not folders. See my query below:

QueryBuilderHi,

When I open the CAML editor and change the view scope from Recursive to RecusiveAll it seems that folders are included. Although my search contains a variable and this doesn't seems to work in the CAML editor.

<View Scope="RecursiveAll">
    <Query>
        <ViewFields>
            <FieldRef Name="ItemChildCount" />
            <FieldRef Name="Name" />
        </ViewFields>
        <Where>
            <And>
                <BeginsWith>
                    <FieldRef Name="Name" />
                    <Value Type="Text">Post Approval Attachments</Value>
                </BeginsWith>
                <Contains>
                    <FieldRef Name="Name" />
                    <Value Type="Text">[%Value:Use text builder%]</Value>
                </Contains>
            </And>
        </Where>
    </Query>
    <RowLimit> 10</RowLimit>
</View>

I've tried to change the <Value Type="Text">[%Value:Use text builder%]</Value> to <Value Type="Text">{Variable:CurrentACPwithoutXML}</Value>.

Any ideas how to include folder items in the query builder or how to use a variable in the CAML editor?

Thanks in advance,

Mark

Labels: (1)
0 Kudos
Reply