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

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

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

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

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

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

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

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 Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 370 members 5,046 guests
Please welcome our newest community members: