Delete folder older than x days in sharepoint

In order to get properties like the Created Date or Last Modified Date you can use the Get List Items activity on your library.
A caml query like the one below will return the properties of all the folders in a SP Library:

<Where>

<BeginsWith>

<FieldRef Name= 'ContentTypeId' />

<Value Type= 'ContentTypeId' >0x0120</Value>

</BeginsWith>

</Where>

You could also use a CAML query which returns all items at a certain path (including your folder), like the one below:

<Query><Where><Eq><FieldRef Name='FileDirRef' /><Value Type='Text'>/sites/jerrydev/doc2/Fred Beans Group (PA)</Value></Eq></Where></Query></View>

The documentation on connect should help you understand how to use these queries. You could also try SmartCaml (free app on the Microsoft Store) to generate queries for you automatically

1 Like