cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mhines
Advocate II
Advocate II

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

 

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

5 REPLIES 5
efialttes
Super User III
Super User III


@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!



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

 

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

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

Martin_MC
Helper II
Helper II

I have this same issue, where I want to retroacitvely make an existing flow only trigger on creations. I have added the trigger condition:

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

 

But with this condition the flow doesn't run at all...? Not on creations. Not on modifications. That seems strange, no? Does anyone know why this might be?

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (54,971)