Hello I'm new to using flow,
I'm trying to clean up my sharepoint by deleting all documents older then 8 years. However there is a limitation of 100 actions that my flow can do and I'm running into the problem that the first 100 actions are always the same document, which are not older than 8 years... The amount of documents are equal to 25000+ documents...
My question: 1. Is it possible to use/make some kind of filter on the get file properties, so that it retrieves files based on modified data? so that my flow will always use the oldest documents in its actions?
2. Is it possible to also filter out the maps from the actions, so that it will only be documents?
3. Is it possible to clean up the documents using Excel? It is possible to receive an overview of the documents in excel... Managing Sharepoint through Excel would be lovely.
thanks in advance!
Solved! Go to Solution.
Hi @Momo,
Do you want to delete only files that haven’t been modified more than 8 years?
Please check the following flow for a reference.
For testing, trigger the flow by a Button.
Add the action Get past time, Time unit set as Year, and Interval as 8.
Add action Get files (properties only), input the following code in the Filter query field:
Modified lt ‘formatDateTime(body('Get_past_time'),'yyyy-MM-dd')’
Note: Please surround the function with a single quote in the Filter query box.
Add a Condition to check if it is a folder or not with the following code:
@equals(items('Apply_to_each')?['{IsFolder}'], bool('false'))
Under if yes branch, add the action Delete file, choose dynamic content Identifier from the action Get files.
By the way, I am not sure with “clean up the document using Excel”, could you share more clarification on it?
Best regards,
Mabel
Hi @Momo,
Do you want to delete only files that haven’t been modified more than 8 years?
Please check the following flow for a reference.
For testing, trigger the flow by a Button.
Add the action Get past time, Time unit set as Year, and Interval as 8.
Add action Get files (properties only), input the following code in the Filter query field:
Modified lt ‘formatDateTime(body('Get_past_time'),'yyyy-MM-dd')’
Note: Please surround the function with a single quote in the Filter query box.
Add a Condition to check if it is a folder or not with the following code:
@equals(items('Apply_to_each')?['{IsFolder}'], bool('false'))
Under if yes branch, add the action Delete file, choose dynamic content Identifier from the action Get files.
By the way, I am not sure with “clean up the document using Excel”, could you share more clarification on it?
Best regards,
Mabel
Hi @v-yamao-msft,
It doesn't really give me the results I was looking for... Is it possible to specify in the action "Get past time" to define an interval, which can be used in the get past files action? So that would be Get past time: >8 Years or Between 8 and 26 years (Thats how old the documents are...)
And another problem of mine is that that the flow can only look at 100 documents during a run. In my case, these 100 documents are always folders, which result in the flow not deleting anything. A solution to this might be the "order by" option within the "Get files" action. However, I do not know the syntax for order by modified date latest to new and IsFolder no to yes (or something similar).
Any Ideas?
And what I actually meant with "clean up the document using Excel" was to manage documents on sharepoint using Excel. But I dont think that it is possible yet. I tried to export file of sharepoint documents (identifier) into excel and delete the documents on sharepoint using the identifier of the file from excel. But it doesn't work for me.
User | Count |
---|---|
5 | |
5 | |
4 | |
2 | |
2 |