cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CristianD Helper I
Helper I

Email flow triggered off after modified SharePoint item - Exclude Past modified items

Hi,

 

I have a flow that is triggered when a Sharepoint list item is created or modified with one condition that one of the fields needs to be completed ( its a date). So when a user adds a date in that field I want a email to be sent. 

This happens but: 

I also update the list each day and that its triggering an email also for ALL past items so it generates a high volume of emails.

 

How can I make it to generate only for the items that are modified after my daily update? 

 

Considerations:

Modified date is going to be changed each day in the morning by me. 

Modified by is going to be me each morning 

 

thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Email flow triggered off after modified SharePoint item - Exclude Past modified items

Hi @CristianD,

 

Do you want to send emails to the user who modified the items after your daily update?

 

I have created a SharePoint list on my side and the data structure of it as below:12.JPG

 

 

I have made a test on my side, please take a try with the following workaround:

  • Add a "When an item is created or modified" trigger, specify Site Address.
  • Add a Condition, click "Edit in advanced mode", type the following formula:
@and(equals(formatDateTime(triggerBody()?['Modified'], 'MM/dd/yyyy'), utcNow('MM/dd/yyyy')),not(equals(triggerBody()?['Editor']?['Email'], 'Test1@xxxxxx.onmicrosoft.com')),not(empty(triggerBody()?['Due_x0020_Date'])))

Note: The 'Test1@xxxxxx.onmicrosoft.com' represents the email address of my SharePoint account, on your side, you should type the email address of your own SharePoint account. The 'Due_x0020_Date' represents the Date column (on my side, it is Due Date) in my SharePoint list, if there is a space within your Date column, please replace the space with '_x0020_'.

 

Image reference:10.JPG

The flow works successfully as below:11.JPG

 

 

More details about using expression in flow actions, please check the following article:

Use expression in flow actions

 

 

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

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Email flow triggered off after modified SharePoint item - Exclude Past modified items

Hi @CristianD,

 

Do you want to send emails to the user who modified the items after your daily update?

 

I have created a SharePoint list on my side and the data structure of it as below:12.JPG

 

 

I have made a test on my side, please take a try with the following workaround:

  • Add a "When an item is created or modified" trigger, specify Site Address.
  • Add a Condition, click "Edit in advanced mode", type the following formula:
@and(equals(formatDateTime(triggerBody()?['Modified'], 'MM/dd/yyyy'), utcNow('MM/dd/yyyy')),not(equals(triggerBody()?['Editor']?['Email'], 'Test1@xxxxxx.onmicrosoft.com')),not(empty(triggerBody()?['Due_x0020_Date'])))

Note: The 'Test1@xxxxxx.onmicrosoft.com' represents the email address of my SharePoint account, on your side, you should type the email address of your own SharePoint account. The 'Due_x0020_Date' represents the Date column (on my side, it is Due Date) in my SharePoint list, if there is a space within your Date column, please replace the space with '_x0020_'.

 

Image reference:10.JPG

The flow works successfully as below:11.JPG

 

 

More details about using expression in flow actions, please check the following article:

Use expression in flow actions

 

 

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

CristianD Helper I
Helper I

Re: Email flow triggered off after modified SharePoint item - Exclude Past modified items

Hi @v-xida-msft, Kris,

 

Thank you, I have implemented it but I received an error message. 

Please have in mind that I want this email to be triggered to a recepient and CCing the requestor (user that modified).

 

This is the code I added ( notice that I have to put one additional email as my colleague updates too. 

 

@and(equals(formatDateTime(triggerBody()?['Modified'], 'MM/dd/yyyy'), utcNow('MM/dd/yyyy')),not(equals(triggerBody()?['Editor']?['Email'], 'user1@company.com'),equals(triggerBody()?['Editor']?['Email'], 'user1@company.com')),not(empty(triggerBody()?['START_x0020_DATE_x0020_ETA'])))

 

This is the error message:

 

InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '2377': 'The template language function 'not' expects one parameter: the boolean value to negate. The function was invoked with '2' parameters. Please see https://aka.ms/logicexpressions#not for usage details.'.

 

Could you please guide me here too? 

 

thanks

Cristian 

CristianD Helper I
Helper I

Re: Email flow triggered off after modified SharePoint item - Exclude Past modified items

hi Kris, 

 

I figured that the Not statement needed and OR to accept 2 conditions. Now works properly ( I hope ) 

 

thank you for the help!

cristian 

Helpful resources

Announcements
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

Top Solution Authors
Users online (8,432)