Hi,
Need to add 365 days to Modified date field and delete the item when it meets the below condition.
Action = Move and Delete and Modified is greater than 365.
Do I need to add a calculated field called DeletionDate in SP ( add 365days and run the below workflow) or the below flow will work? I dont
The items need to remain in the list for a year from modified date and should be deleted only when Modified + 365 days and Action = Move and Delete.
Modified lt '@{addDays(utcNow(),-365,'yyyy-MM-dd')}' and Action eq 'Move&Delete'
Thanks in Advance.
Pbala
Solved! Go to Solution.
If you run the flow, you can examine the run time history. You will see how the Filter query expression is evaluated during execution:
The expression will therefore select files where the Modified date is less than 2020-09-09 - in other words it gets files that are older than 2020-09-09 - 1 year or older. As far as I am aware, when using operators, the expressions need to be inside brackets:
(Modified lt '@{addDays(utcNow(),-365,'yyyy-MM-dd')}') and (Action eq 'Move&Delete')
You can use a Select operation, as shown below, to select just the filename and the Modified date from the dataset produced by the Get Files action, then create HTML table and email that as a report:
Hope this helps.
Ellis
The expression will need to be grouped in brackets:
(Modified lt '@{addDays(utcNow(),-365,'yyyy-MM-dd')}') and (Action eq 'Move&Delete')
Ellis
Hi Ellis,
The expression works for me, but I am trying to understand date the logic.
Does this expression translate to below statement?
(Modified lt '@{addDays(utcNow(),-365,'yyyy-MM-dd')}') and (Action eq 'Move&Delete')
For example if the modified date is 9/9/2021. The flows needs to add 365 days to the date ( 9/9/2022) and on (9/10/2022) , if action condition is also true, it needs to delete the item.
In the past (SP designer), I have created a calculated date column and compared against it, trying to understand flow expressions.
Thanks much,
Pbala
If you run the flow, you can examine the run time history. You will see how the Filter query expression is evaluated during execution:
The expression will therefore select files where the Modified date is less than 2020-09-09 - in other words it gets files that are older than 2020-09-09 - 1 year or older. As far as I am aware, when using operators, the expressions need to be inside brackets:
(Modified lt '@{addDays(utcNow(),-365,'yyyy-MM-dd')}') and (Action eq 'Move&Delete')
You can use a Select operation, as shown below, to select just the filename and the Modified date from the dataset produced by the Get Files action, then create HTML table and email that as a report:
Hope this helps.
Ellis
This makes sense. Thank you.
User | Count |
---|---|
92 | |
44 | |
21 | |
18 | |
16 |
User | Count |
---|---|
137 | |
49 | |
42 | |
37 | |
29 |