Morning,
Does anyone know if it is possible to create a flow that only triggers after an item has not been modified for a certain amount of time? For example, I want to create a flow that uses the "When an item is created or modified" trigger, but right beneath that, has a condition that asks the question, "Has this item not been modified in the past fifteen minutes?" before proceeding...
I realize this is a super-specific question, so let me know if need to explain myself a bit more.
Thanks in advance for all your help.
Hi @nelsonbj,
Do you want to check if an item of your SharePoint list not been modified in the past fifteen minutes?
If you want to check if the item is not been modified in the past fifteen minutes, you should customize a column to store the last modified time of this item within your SharePoint list. Then compare the modified time of this item with the last modified time of this item and check if the item is not been modified in the past 15 minutes.
I have created a SharePoint list on my side and the data structure of it as below:
Note: TaskName column is a Single line of text type column. Executor column is a Single line of text type column. The Last Modified Time column is a Date and Time type column, which is used to store the last modified time of the item. The Manually Modifed column is a Yes/No type column and the default value of it is No, when the users modify the item, they should change the value of this column into Yes.
I have made a test on my side and please take a try with the following workaround:
@empty(triggerBody()?['Last_x0020_Modified_x0020_Time'])Within "If/yes" branch of Condition, add a "Update item" action, Last Modified Time field set to Modified dynamic content of the trigger, Manually Modify field set to No.
@equals(triggerBody()?['Manual_x0020_Modify'], true)
Within "If/yes" branch of Condition 2, Add a Condition 3, click "Edit in advanced mode", type the following formula:
@lessOrEquals(formatDateTime(addMinutes(triggerBody()?['Last_x0020_Modified_x0020_Time'], 15), 'MM/dd/yyyy HH:mm'), formatDateTime(triggerBody()?['Modified'], 'MM/dd/yyyy HH:mm'))
Within "If/yes" branch of Condition 3, add a "Send an email" action to notify the item is not been modified in the past 15 minutes. Then add a "Update item 2" action, Last Modified Time field set to Modified dynamic content of the trigger, Manually Modify field set to No.
Within "If/no" branch of Condition 3, add a "Update item 3" action, Last Modified Time field set to Modified dynamic content of the trigger, Manually Modify field set to No.
Image reference:
The screenshot of actions of Condition 3:
The flow works successfully as below:
Best regards,
Kris
Kris,
Thanks for your help. Trying your workaround, I got the following error.
That was after I built the flow like...
Also, I wanted to ask you... at what point during the flow would the Manually Modified column change to Yes? As you explained, this column will switch to yes any time a user makes edits... but I am not seeing where in the flow such a change would take place.
Finally, just to make sure I understand your workaround correctly... if I were to add additional actions after an item has not been modified after fifteen minutes, I would simply place them under the "If/yes" section of Condition3?
Thanks again for your help.
Thought of another question...
Will this workaround trigger for each updated item after fifteen minutes? Or would I be able to make four different edits in quick succession, then have the workflow only be triggered once since they all happened within fifteen minutes?
User | Count |
---|---|
87 | |
72 | |
44 | |
26 | |
25 |
User | Count |
---|---|
42 | |
25 | |
23 | |
23 | |
17 |