cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Alam Helper II
Helper II

Flow: Existing item is modified triggers when a new item is created in Sharepoint list

 

How do I resolve this?

 

I have two flows and both are being triggered when a new item is created. Flow issue.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Flow: Existing item is modified triggers when a new item is created in Sharepoint list

Hi @Alam,

 

Could you please share a screesnshot of each of your two flow's configuration?

Do you use the "When an item in a SharePoint list is modified send an email" built-in template to create your flow?

 

I suppose that you use the "When an item in a SharePoint list is modified send an email" built-in template to create your flow, is it true? The issue is confirmed on my side, when I add a new item in my SharePoint list, the "When an existing item is modified" trigger fires.

 

Actually, the "When an existing item is modified" trigger is not supported in SharePoint connector within Microsoft Flow currently, the SharePoint connector in Microsoft Flow only support the "When an item is created" trigger and the "When an item is created or modified" trigger. I think the trigger witin the "When an item in a SharePoint list is modified send an email" built-in template is the "When an item is created or modified" trigger, the template just translate the display name of the trigger into another display name.

 

In addition, if you want to trigger the flow only when an existing item is modified in your SharePoint list, you could consider add the "When an item is created or modified" as the trigger of your flow and add a Condition to check if the existing item is modified trigger yur flow. I have made a test on my side and please take a try with the following workaround:

  • Add a "When an item is created or modified" trigger.
  • Add a Condition, click "Edit in advanced mode", type the following formula:
@equals(triggerBody()?['Created'], triggerBody()?['Modified'])
  • Within "If/no" branch of Condition, add a "Send an email" action.

Note: If you modify an existing item in your SharePoint list, the result the Condition box calculate is false. If you create a new item in your SharePoint list, the result the Condition box calculate is true.

 

Image reference:5.JPG

The flow works successfully as below:6.JPG

 

 

More details about SharePoint connector, please check the following article:

SharePoint connector

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

26 REPLIES 26
wnzn Advocate IV
Advocate IV

Re: Flow: Existing item is modified triggers when a new item is created in Sharepoint list

Where did you get that trigger? AFAIK there are only the When an item is created and When an item is created or modified trigger, not one specifically for modified items. You could use that second trigger and then add a condition to your flow to check whether the item is new (created equals modified) and work from there.

Community Support
Community Support

Re: Flow: Existing item is modified triggers when a new item is created in Sharepoint list

Hi @Alam,

 

Could you please share a screesnshot of each of your two flow's configuration?

Do you use the "When an item in a SharePoint list is modified send an email" built-in template to create your flow?

 

I suppose that you use the "When an item in a SharePoint list is modified send an email" built-in template to create your flow, is it true? The issue is confirmed on my side, when I add a new item in my SharePoint list, the "When an existing item is modified" trigger fires.

 

Actually, the "When an existing item is modified" trigger is not supported in SharePoint connector within Microsoft Flow currently, the SharePoint connector in Microsoft Flow only support the "When an item is created" trigger and the "When an item is created or modified" trigger. I think the trigger witin the "When an item in a SharePoint list is modified send an email" built-in template is the "When an item is created or modified" trigger, the template just translate the display name of the trigger into another display name.

 

In addition, if you want to trigger the flow only when an existing item is modified in your SharePoint list, you could consider add the "When an item is created or modified" as the trigger of your flow and add a Condition to check if the existing item is modified trigger yur flow. I have made a test on my side and please take a try with the following workaround:

  • Add a "When an item is created or modified" trigger.
  • Add a Condition, click "Edit in advanced mode", type the following formula:
@equals(triggerBody()?['Created'], triggerBody()?['Modified'])
  • Within "If/no" branch of Condition, add a "Send an email" action.

Note: If you modify an existing item in your SharePoint list, the result the Condition box calculate is false. If you create a new item in your SharePoint list, the result the Condition box calculate is true.

 

Image reference:5.JPG

The flow works successfully as below:6.JPG

 

 

More details about SharePoint connector, please check the following article:

SharePoint connector

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

antidiminutive
Frequent Visitor

Re: Flow: Existing item is modified triggers when a new item is created in Sharepoint list

This solution works well and is the only way to keep flows that modify an item with a create/modify trigger from running continuously in a loop. I was able to successfully create a condition that checks to verify that multiple fields are populated and if so sends it to a terminate command with a Cancelled status. If those fields are not populated correctly, it runs the the 'no' condition. Setting the type of termination in the 'yes' result is helpful in troubleshooting.

 

If you are using expressions that use the @or or @and functions, I highly recommend that you validate each element in the logic first. The flow run history doesn't show what makes the condition false.

Bobs
Regular Visitor

Re: Flow: Existing item is modified triggers when a new item is created in Sharepoint list

Hi Kris,

 

I added the condition as described, but my flow only appears to run when a new item is created in the SharePoint list.

Am I missing something?

When I modify an item in the SharePoint list the modified value changes so it is different than created, but it appears that the trigger is never run.

When an item is created or modified.PNG

 

 

 

BudimanWibawa
New Member

Re: Flow: Existing item is modified triggers when a new item is created in Sharepoint list

I think the workaround is something like this

 

@not(equals(triggerBody()['Created'], triggerBody()['Modified']))

 

And put the next action, in NO condition 

Super User
Super User

Re: Flow: Existing item is modified triggers when a new item is created in Sharepoint list

It looks Microsoft might have fixed this. Up until last week whenever a new SharePoint list item was created it ran the Flow twice because SharePoint adds a date into the Modified column as well. However today I have tested a couple of my Flows and they now only trigger a single email for a new item. It does seem to send the email a bit slower than it did (sometimes it can take 3 or 4 minutes for the email to be received) but if the fix really is done I can live with that.

Bobs
Regular Visitor

Re: Flow: Existing item is modified triggers when a new item is created in Sharepoint list

Good to know, I will also test to see if the trigger works on both new and modified items

Highlighted
bcameron1231
New Member

Re: Flow: Existing item is modified triggers when a new item is created in Sharepoint list

Just a quick heads up. I've been using this method for a while now, but it turns out it is not 100% accurate. I've found the Created and Modified sometimes have different values on new item creation. In my testing, I've found that they are off by .02 and .03 seconds.  My method for "fixing" this is to just add 1 second to created and see if it's > Modified. Not a great solution, but it's working.

NDA1974
Frequent Visitor

Re: Flow: Existing item is modified triggers when a new item is created in Sharepoint list

Caution: I've used this technique comparing modified and created date, but having a powershell script creating lots of list items results in Created and Modified differs. This is of cause strange but nevertheless the case.

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Users online (6,871)