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 / Circular reference Iss...
Power Automate
Answered

Circular reference Issue - Need to Stop a Flow from Re-Running - D365

(0) ShareShare
ReportReport
Posted on by 203

I'm having an issue where I'm using a Flow to update a record in D365 that was just updated by some manual user input in D365 (rather than using traditional D365 workflows). The problem is that since the update is happening on the same record on the same table, it's seemingly firing the Flow again into an infinite loop. Is there any way to prevent this? 

Categories:
I have the same question (0)
  • RezaDorrani Profile Picture
    12,145 on at

    Hi @saturation 

     

    In Flows now you can do conditional triggering

    https://www.youtube.com/watch?v=j-gP-E6CCE4

     

    You would have to setup the expression based on your scenario

    may be set a column value or check the last modified date

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • saturation Profile Picture
    203 on at

    Interesting. Watched the video. I guess I'm looking for ever further guidance. I would like to see if a field I created called new_testfield has changed. The question is, there's no guidance on the syntax for a trigger like this. How would I check to see if a field called "new_testfield" has changed using the Trigger Condition?

  • RezaDorrani Profile Picture
    12,145 on at

    Hi @saturation 

     

    @not(equals(triggerbody()?['fieldinternalname']),null)

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • saturation Profile Picture
    203 on at

    Thanks, after thinking that through, I guess that won't fully detect whether the update was done by a user clicking Save in D365 or whether the update was done from a Flow. Is there any way to detect which did the update so that if it's done by Flow, it doesn't keep looping through the Flow?

  • Verified answer
    RezaDorrani Profile Picture
    12,145 on at

    Hi @saturation 

     

    You would have to maintain some flag in order to do this

    When flow updates it - set flag to 1

    when manually done - set flag to 0

     

    and then u can trigger conditionally nly if flag value is 1

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • Verified answer
    saturation Profile Picture
    203 on at

    Sounds like I would need a hidden field on the form so when it's saved, it sets that value to 1. Then, when it runs in Flow, set the trigger only where it's 1, and then at the end of the Flow, set it back to 0?

  • saturation Profile Picture
    203 on at

    @RezaDorrani 

     

    @not(equals(triggerbody()?['msflowtrigger']),0)

    I also tried 

    @not(equals(triggerbody()?['msflowtrigger']),'0')

     

    Request to Azure Resource Manager failed with error: '{"error":{"code":"InvalidTemplate","message":"The template language expression evaluation failed: 'The template language function 'equals' expects two parameters: the values to test for deep equality. The function was invoked with '1' parameter(s). Please see https://aka.ms/logicexpressions#equals for usage details.'."}}'.

  • RezaDorrani Profile Picture
    12,145 on at

    Hi @saturation 

     

    try

     

    @equals(triggerbody()?['msflowtrigger'],'0')   assuming msflowtrigger is a text field

  • saturation Profile Picture
    203 on at

    🙂 Well that explains it--my field is an integer...What's the syntax then testing an integer?

     

    @RezaDorrani 

     

    And by the way your help is very much appreciated.

  • RezaDorrani Profile Picture
    12,145 on at

    @saturation 

     

    fastest way out - make it a text field since it is hidden anyways

     

    for whole number

    try @equals(triggerbody()?['msflowtrigger'],0)

     

    or @equals(triggerbody()?['msflowtrigger'],int(0))  

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 639

#2
Valantis Profile Picture

Valantis 392

#3
11manish Profile Picture

11manish 350

Last 30 days Overall leaderboard