web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Help with Trigger Cond...
Power Automate
Answered

Help with Trigger Conditions

(0) ShareShare
ReportReport
Posted on by 253

Okay, this one is pretty simple; I just don't have the knowledge base to do it myself.

I am trying to eliminate a clunky "loop-kill" condition within my flow by using a trigger condition to prevent the flow from running.

Tmalonson_0-1708547988602.png

Problem is, I don't know how to do that... 😅😐

 

Here's the set-up:
I have a SharePoint Document Library.
Within the properties, there is a Date/Time column called "Flow Modified"
This is necessary because the flow updates file properties within the Document library (but it also triggers on creation/modify);
so, at the end of the flow it updates the Flow modified column with the current timestamp.

I have a loop-kill condition in the flow that used to work well, but I think Power Automate made some back-end updates when they moved over to the new editor that has made it less-viable.
So, I could really use some help; here are the conditions that it should trigger on.
1. IF[ Flow Modified is Null ]
2. IF[ Flow Modified is NOT Null ] AND IF[ Flow Modified is <= to UTCnow(minus 10 minutes]

 

These conditions result in the following:

The flow will only trigger if the Flow modified column has a timestamp older than 10 minutes.

How do I code those into this?
Tmalonson_0-1708547988602.png

Thanks,

Categories:
I have the same question (0)
  • Verified answer
    v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @Tmalonson 

    According to your description, you want to set the trigger condition, you can try to refer to this code :

    or(
     equals(triggerOutputs()?['body']?['Flow Modified internal name'] , null ),
    and( not(equals(triggerOutputs()?['body']?['Flow Modified internal name'] , null )) , lessOrEquals( triggerOutputs()?['body']?['Flow Modified internal name'] ,addMinutes(utcNow(),10) ))
    )
    

     

    And you can turn on the "split on" in the setting of the trigger.

    vyueyunmsft_0-1708565284312.png

    The column internal name you can get in the sharePoint url.

    How to find the internal name of list or library columns – SharePoint Stuff

     

    Best regards,

    Yueyun Zhang

  • Tmalonson Profile Picture
    253 on at

    Yes, thank you; I knew I needed to set trigger condition, I simply am not adept at coding 😅
    I'll give this a try and get back to you.

  • Tmalonson Profile Picture
    253 on at

    I am receiving the following error, (I have verified that the column name is 'FlowModified' within SP setting and by inputting a dynamic action elsewhere).

    "The power flow's logic app flow template was invalid. The template condition expression 'or( equals(triggerOutputs()?['body']?['FlowModified'] , null ), and( not(equals(triggerOutputs()?['body']?['FlowModified'] , null )) , lessOrEquals( triggerOutputs()?['body']?['FlowModified'] ,addMinutes(utcNow(),10) )) )' at line '1' and column '985' is not valid template language expression"

    Also, it seems like turning on "Split" results in not being able to access the individual data outputs from the trigger, only a body/value list. Is it required?

  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @Tmalonson 

    Thanks for your response! You need to add the '@' in the first of the expression , like this:

    vyueyunmsft_0-1708654063610.png

     

     

    Best Regards,

    Yueyun Zhang

  • Tmalonson Profile Picture
    253 on at

    Hey Zhang,
    Sorry for the late response, I had other things to worry about last week.

     

    I actually ended up re-working the whole process and removing the self-trigger conditions entirely.
    I do believe that this would've worked and I am going to mark it as the solution.

  • Tmalonson Profile Picture
    253 on at

    Hey Yueyun,

    I think I actually will still need to use a portion of this trigger condition to prevent this from running when a new source folder is created as opposed to the subfiles being uploaded (when I want it to run).

    I should be able to use the second portion of the code you provided, seeing as When the file is created, the flow modified column is filled using utcnow().
    Currently, the flow runs anyway and fails to no consequence (because the trigger-file being created already has all of the correct property information, which is what the flow is meant to populate).
    So, I tried to use your provided solution.

     

     

    @
    or(
     equals(triggerOutputs()?['body']?['FlowModified'] , null ),
    and( not(equals(triggerOutputs()?['body']?['FlowModified'] , null )) , lessOrEquals( triggerOutputs()?['body']?['FlowModified'] ,addMinutes(utcNow(),10) ))
    )

     

     

     

    Here is the problem which this presents;
    Now, when I try to use a For Each loop in reference to the Trigger Item, it says that the body/value Array is invalid and null. 
    So, I turned on spilt tracking and entered the @triggeroutputs()?[body/value] as you had previously shown and this did not seem to fix the issue.

    Tmalonson_0-1710430361190.png


    When I tried to select the for each and correct the source, it did not give me the option o select the body/value outputs.

    Tmalonson_1-1710430423341.png


    What would cause that, and how can I fix it? 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 273 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 175 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 146 Super User 2026 Season 2

Last 30 days Overall leaderboard