2

I would like to be able to delete all files added today (files could be added to different folders within the document library). The Created and Modified field has the date the file itself was created, so I am not able to filter by them.

I tried creating a view with Content Type set to Document but it kept complaining that I have more than 5000 rows and cannot show it. So, how can I retrieve them?

I am more than happy to just delete all files (the folders need to exist though).

3 Answers 3

3

Try with powershell

https://www.sharepointsky.com/delete-list-items-created-n-days-using-powershell-sharepoint-online/

Instead of <Today OffsetDays="-7"/> put <Today/>

Note: replace all with "

similar question https://stackoverflow.com/questions/18362853/how-do-i-filter-by-today-and-time-in-sharepoint-list-view

0

There might be a 3rd option you can use.

You have the ability to use CSOM to retrieve all changes for a site, web or list.

This allows you to iterate over all changes that happend since a certain point in time, and act on each of them. Not sure how you want to handle updates for example, but it can get you started.

In order to get them you need to call the GetChanges of one of these objects. The paramater can be passed in with a timestamp.

Here is the method for a SPList: https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.list.getchanges%28v=office.15%29.aspx

and here you can have a look at the input for that method: https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.changequery%28v=office.15%29.aspx

Hope that helps

-1

use the below query to filter the items by today,

 <Query>
                <OrderBy>
                    <FieldRef Name="Modified" Ascending="FALSE"/>
                </OrderBy>
                <Where>                   
                        <eq>
                            <FieldRef Name="created"/>
                            <Value Type="DateTime" >
                                <Today/>
                            </Value>
                        </eq>   
                </Where>
            </Query>
3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.