cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Alam
Level: Powered On

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
Highlighted
Community Support Team
Community Support Team

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

25 REPLIES 25
wnzn
Level 8

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.

Highlighted
Community Support Team
Community Support Team

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
Level: Powered On

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
Level: Powered On

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
Level: Power Up

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
Level: Powered On

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

bcameron1231
Level: Power Up

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
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users Online
Currently online: 115 members 5,194 guests
Please welcome our newest community members: