0

I have a Sharepoint list in O365 which is used to capture records from an SQL database through a Power Automate flow.

This works.

I have a second flow which is triggered when a record (specifically one field) is modified. This then pushes data back to my database.

This also works.

The problem I have is with the 2nd flow, which runs as many times as I have columns. So if I have 10 columns it runs 10 times, if I have 3 (tested a similar process but without the SQL update in my Dev environment) it runs 3 times.

Does anyone have any idea why this might be happening, or how I can prevent it?

Start of

The formula in the 'since' fieldis this:

sub(int(triggerOutputs()?['body/{VersionNumber}']),1)

Compose and condition

Final Action (SQL Removed)

Results of modifying 1 field

Results

S8Tony
  • 85
  • 1
  • 1
  • 9
  • have you tried using trigger condition on the "When an item or file is modified" connector? https://www.spguides.com/power-automate-trigger-conditions/ – jimas13 Oct 05 '22 at 08:27
  • Hi @jimas13, yes that's exactly what I use (see first screenshot) – S8Tony Oct 05 '22 at 16:15
  • @jimas13 I may have been hasty. I haven't added a trigger condition, and can't see an example in your link for when a specific column has changed – S8Tony Oct 05 '22 at 17:18
  • https://www.spguides.com/power-automate-trigger-conditions/#:~:text=Now%2C%20we%20will%20add%20the%20trigger%20condition%20that%20will%20trigger%20only%20when%20the%20vendor%20is%20equal%20to%20Dell.%20To%20add%20the%20condition%2C%20go%20to%20the%20setting%20on%20the%20trigger%20and%20add%20the%20below%20expression%3A – jimas13 Oct 05 '22 at 17:47
  • Hi @S8Tony, in the above comment you will see that we set "@equals(triggerBody()?['Vendor'], 'Dell')" and the trigger will get executed only when the column vendor was created or modified with the value of 'Dell'. It's like the expression is only evaluated during runtime. If false the flow will not trigger. Try it an see if it worked :) – jimas13 Oct 05 '22 at 17:49
  • @jimas13 thank you so much for the link, it helped me immensely. I'm still getting some repetition but only 5 times now, so some further work to do I think. Here's the trigger setting I'm using: @and(not(empty(triggerBody()?['field_10'])),not(equals(triggerBody()?['Editor']?['DisplayName'],'Info'))) – S8Tony Oct 14 '22 at 09:39
  • from the trigger syntax i get that there is an update action performed by some "Info" account. Maybe the triggering of the flow is executed from different flows that affect some of the items. – jimas13 Oct 14 '22 at 11:43

1 Answers1

0

In order to recap our conversation in the comments section.

It is possible to control Flow Execution by utilizing the trigger of the Flow connection and setting a logical calculation based on which, if it evaluates to True then the Flow will execute and if it evaluates to False then the Flow will disregard the trigger event and not execute.

You can view examples of the above practice in the link where a trigger is set to

@equals(triggerBody()?['Vendor'], 'Dell')

and a visual representation is below:

Settings for 'When an item is created or modified'

This results in a controlled execution of the Flow, when the change event has the Vendor column set to Dell

jimas13
  • 597
  • 5
  • 19