Hi all, I'm hoping someone can help me understand filters on the Dataverse Modified trigger.
We have a flow that is supposed to trigger when an Invoice record has its statecode CHANGED to "Paid". Additionally, another optionset on the record should be a particular value, but this does seem to be relevant in this question? If so, note that the second optionset's value was not changed, but was at the correct value for the filter.
Based on this, we have set the trigger up as so:
What's happening, though, is that if two changes are made to the record within a short space of time, even if only one of them updates the statecode, the flow executes twice. According to MS Support, this is by design as per this page: Trigger flows when a row is added, modified, or deleted "If there are multiple updates to a single row in a table, Power Automate evaluates the trigger for each update, even if the values that are being updated on the row are the same as the previous value. These updates could lead to multiple flow runs.".
Except this line, later in the same document, seems to indicate that you should be able to limit the trigger to the changing of a specific field (it also seems incorrect, since we are getting two triggered executions despite limiting the trigger to a single field which is only changed once): "Use the Select columns box to define the specific columns of the row that should cause the flow to run when changed, as a comma-separated list of unique column names.". If I've misunderstood, then I don't understand the point of the Select field in this trigger?
According to MS Support, the payload for both trigger executions contained the statecode, despite it only being changed once, hence why the flow tiggered twice, but this is in accordance with the first statement above, they say.
When I asked how we're supposed to ensure the logic runs once only, I was told to either interrogate any expected updates to records first (not an option, since the asynchronous nature of this process means that records may not yet be updated at the time of the query, but are in the process of being updated), or to interrogate the audit logs to check if the statecode was indeed updated twice, but how would the flow know if its instance is the correct one that should run (also, not all entities have audit enabled!)!?
I'm convinced I'm missing something obvious here, but MS Support doesn't seem to have a resonable answer, the MS documentation seems to be contradictory, and I'm sitting with a production problem of occassional record duplications causing money loss to the client...
Can anyone help me understand, please?
Thanks!
James