I am trying to retrieve all the documents within a specified folder (including subfolders) and order them Ascending. I am getting all the documents but they are not ordered.
This is what I have so far:
const libraryName = "Approved Policies and Procedures";
const groupFolderPath = `${this._pageContext.web.serverRelativeUrl}/Approved Policies and Procedures/1. Telkom Group`;
const corpFolderPath = `${this._pageContext.web.serverRelativeUrl}/Approved Policies and Procedures/4. Corp Centre`;
const groupQuery = `
<View Scope="RecursiveAll">
<Query>
<OrderBy>
<FieldRef Name="Title" Ascending='True'/>
</OrderBy>
<Where>
<And>
<Eq>
<FieldRef Name="FSObjType" />
<Value Type="Integer">0</Value>
</Eq>
<BeginsWith>
<FieldRef Name="FileRef" />
<Value Type="Text">${groupFolderPath}</Value>
</BeginsWith>
</And>
</Where>
</Query>
</View>
`;
I have tried adding the ORDERBY after the WHERE clause, but still not ordered!
Any help\guidance will be appreciated
groupQuery
?