Hello,
I have a Flow set to update file (invoices) properties with calculated Subtotal and GST based on whether the item has GST or not. It works great and the trigger conditions I have set are logical (in my opinion) and for the most part, it works to prevent infinite looping. Except for just a few files. The files that manage to bypass the trigger conditions all have the same value (except one). The Flow enters an infinite loop every time that file is updated, like when the 'Paid' property is ticked, or a new invoice is added with that value.
The trigger condition simply checks if the 'SubTotal' value is null or if the resultant of 'SubTotal'+'GST' does not equal 'Invoice_Total'.
The trigger condition is as follows:
@Anonymous(equals(triggerOutputs()?['body/SubTotal0'],null),not(equals(triggerOutputs()?['body/Invoice_x0020_Total'],add(triggerOutputs()?['body/GST0'],triggerOutputs()?['body/SubTotal0']))))
As mentioned, it works well, except for one group of files, which, ironically, are monthly subscription invoices for Microsoft with an 'Invoice_Total' of $18.92 (the sum of 'SubTotal' $17.2 and 'GST' $1.72
It seems to be a number issue. If the 'Invoice_Total' value is changed, it works fine. From what I can tell, the trigger condition regards not(18.92=17.20+1.72) as a 'true' result, therefore the condition to trigger is met.
The other invoice is a one off with an 'Invoice_Total' $36.63 The 'Invoice_Total' was changed and it works fine. When changed back, it triggers again and goes infinite.
As mentioned, this works fine for all invoices except the ones with values noted above.
What am I not seeing that is causing these particular values to trigger infinate loops?

Report
All responses (
Answers (