0

How can I write LIKE 'String*' in CAML? I must create a query to display the folder structure.

1

This gets all folders and files under a specified folder:

<View Scope='RecursiveAll'>
    <Query>
        <Where>
            <Eq>
                <FieldRef Name='FileDirRef' />
                <Value Type='Text'>MyFolderPath</Value>
            </Eq>
        </Where>
    </Query>
</View>
  • But i want to see all the files under the root folders and all folders unbder a root folder and when I click I want to see all folders and a all files too. – Grzegorz Z Jul 24 '14 at 18:40
  • 1
    Does my edit address your needs? – wjervis Jul 24 '14 at 18:58
  • No because when I Click folder it no show whot is on folder. It Show nothing, – Grzegorz Z Jul 24 '14 at 19:03
  • I want combine this View with root folder and show all files on folder. Please help me. – Grzegorz Z Jul 24 '14 at 19:04
  • 1
    Is this a custom web part you are using? I need more info about what is going on. You say you need it to do something when you click on the folder. What code is being executed when you click the folder? – wjervis Jul 24 '14 at 19:21
0

You can use BeginsWith in the CAML query.

"<Where><BeginsWith><FieldRef Name='Title'/><Value Type='Text'>TestTitle</Value></BeginsWith></Where>";

Refer this link for more information.

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.