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

Email flow triggered off modified SharePoint item

Well I'm stuck on a flow that I can't seem to figure out for the life of me. What I'm attempting to do is trigger an email (several different flows I'm attempting to build but this is an example one) whenever a SharePoint item and specifically a particular column is changed. I'm trying to get this to only trigger once so my users aren't bombarded with emails but so far no luck with that. What I want to do is if the Assigned by Manager ['Assigned_x0020_to_x0020_by_x0020'] field gets populated and the Inital Response ['Response_x0020_Notes'] is blank I want an email to be sent. When I use the following 2 condition examples below, one will always trigger (which is no good) and the second one that seems to make sense in my head always comes back as false.

 

Example 1 (will trigger an email everytime the list is modified): @and(not(empty(triggerBody()?['Assigned_x0020_to_x0020_by_x0020'])),not(empty(triggerBody()?['Response_x0020_Notes'])))

Example 2 (should work for what I'm trying to accomplish but always comes back false): @and(empty(triggerBody()?['Response_x0020_Notes']),not(empty(triggerBody()?['Assigned_x0020_to_x0020_by_x0020'])))

 

Failed_flow.png

1 ACCEPTED SOLUTION

Accepted Solutions
Villanous
Level: Powered On

Re: Email flow triggered off modified SharePoint item

Thanks for the reply Michael, I was actually able to resolve my issue by using nested conditions so that the emails would only trigger would 3 or 4 different conditions were met. So far so good in my testing so we shall see how it goes.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Email flow triggered off modified SharePoint item

Hi @Villanous,

 

Just from the condition formula and the running result, I suspect the response notes field always contains a string.

Comparing the two formulas:

@and(
       not(empty(triggerBody()?['Assigned_x0020_to_x0020_by_x0020'])),
       not(empty(triggerBody()?['Response_x0020_Notes']))
      )

And:

@and(
empty(triggerBody()?['Response_x0020_Notes']),
not(empty(triggerBody()?['Assigned_x0020_to_x0020_by_x0020']))
)

The only difference is the Response notes field.

Empty function would work when there is no input for the special field, if the field has been updated and modified once, then this function may not work as expected.

Please consider change the Response Notes to a special string, like "No response" to mark the empty status, then change the formula as:

@and(
   equals(triggerBody()?['Response_x0020_Notes'],'No Response'),
   not(empty(triggerBody()?['Assigned_x0020_to_x0020_by_x0020']))
)

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Villanous
Level: Powered On

Re: Email flow triggered off modified SharePoint item

Thanks for the reply Michael, I was actually able to resolve my issue by using nested conditions so that the emails would only trigger would 3 or 4 different conditions were met. So far so good in my testing so we shall see how it goes.

View solution in original post

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

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

Top Solution Authors
Top Kudoed Authors
Users online (10,627)