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?
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))
🙂 Well that explains it--my field is an integer...What's the syntax then testing an integer?
And by the way your help is very much appreciated.
Hi @saturation
try
@equals(triggerbody()?['msflowtrigger'],'0') assuming msflowtrigger is a text field
@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.'."}}'.
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?
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
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?
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
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?
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