cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
nelsonbj
Level: Powered On

Conditions When Triggering a Flow

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.

3 REPLIES 3
Community Support Team
Community Support Team

Re: Conditions When Triggering a Flow

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:2.JPG

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:

  • Add a "When an item is created or modified" trigger.
  • Add a Condition, click "Edit in advanced mode", type the following formula:
  • @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.
  • Within "If/no" branch of Condition, add a Condition 2, click "Edit in advanced mode", type the following formula:
@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:3.JPG

 

The screenshot of actions of Condition 3:

4.JPG

The flow works successfully as below:

 

5.JPG

 

Best regards,

Kris 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
nelsonbj
Level: Powered On

Re: Conditions When Triggering a Flow

Kris,

 

Thanks for your help.  Trying your workaround, I got the following error.FlowRun1.jpg

 

 

 

That was after I built the flow like...EditFlow(1).pngEditFlow(2).jpgEditFlow(3).jpg

 

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.

 

 

 

 

nelsonbj
Level: Powered On

Re: Conditions When Triggering a Flow

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?

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,058)