cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Community Support
Community Support

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

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

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 

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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (2,957)