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

Trigger Condition expression for Created Documents vs Modified Documents

Several months ago, I had to create several workflows that were initially planned to be for whenever a SharePoint document was created and/or modified. It worked well, but now there has been a change in the process and I need to adjust the workflow to only be triggered when the document is created.

 

I know that the Flow can be recreated using the SharePoint "When a file is created (properties only)", but with issues with using "My Clipboard", recreating these 20 workflows will be very time consuming. I have been able to add in the condition that compares the Created to the Modified values, I'm hoping that there is a way to use Trigger Conditions so that the Modified documents don't count against my Flow Runs. I've used Trigger Conditions on another Flow, but it was because I was able to find the expression that fit exactly what I needed. Does anyone have the expression for stopping documents that are modified?

 

Below is how I've been able to get the Flow to continue to work without recreating the Flow from scratch, but it does count against runs of the Flow.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Trigger Condition expression for Created Documents vs Modified Documents

 

Hi @mhines ,

 

Please use this expression:

 

@equals(triggerBody()?['Created'], triggerBody()?['Modified'])

 

 

Best Regards, 

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Dual Super User
Dual Super User

Re: Trigger Condition expression for Created Documents vs Modified Documents


@mhines wrote:

I have been able to add in the condition that compares the Created to the Modified values, I'm hoping that there is a way to use Trigger Conditions so that the Modified documents don't count against my Flow Runs. I've used Trigger Conditions on another Flow, but it was because I was able to find the expression that fit exactly what I needed. Does anyone have the expression for stopping documents that are modified?

Yes we can!

Did you try to compare triggerBody()?['Created'] and triggerBody()?['Modified'] by means of equal() function in your Conditional trigger?

 

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



mhines
Level: Powered On

Re: Trigger Condition expression for Created Documents vs Modified Documents

I thought I had tried, but I keep on getting messages that my expression is invalid. I've tried so many variations that I'm pretty lost now at what's next.

Annotation 2020-02-26 1435267.pngAnnotation 2020-02-26 143526.png

Community Support Team
Community Support Team

Re: Trigger Condition expression for Created Documents vs Modified Documents

 

Hi @mhines ,

 

Please use this expression:

 

@equals(triggerBody()?['Created'], triggerBody()?['Modified'])

 

 

Best Regards, 

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

mhines
Level: Powered On

Re: Trigger Condition expression for Created Documents vs Modified Documents

Thank you so much. This appears to have done the trick!

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (5,375)