Sharepoint List email automation based on last modified

Grendall 21 Reputation points
2022-06-17T13:08:06.497+00:00

Hi,

I didn't quite find what I was looking for.
I have a list which contain updates on project and I would like to send an automated email when the modified date is more than 30 days old.
It's my understanding than a rule cannot be based on the last modified column. I tried using power automate and a flow but I do not find the right trigger for it, for example if I use "when an item is modified" it wont check the whole list and also someone need to change something. I would like to check once a day automatically.
When I tried "scheduled cloud flow" then it is not linked to my SP list...

Can anyone point me out in the right direction?
Thanks

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,684 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,811 questions
{count} votes

Accepted answer
  1. Yanli Jiang - MSFT 21,611 Reputation points Microsoft Vendor
    2022-06-21T07:09:44.247+00:00

    Hi @Grendall ,
    Your requirements can be implemented using Power automate.
    The list used in the test is as follows:
    213273-06217.png

    Create a new flow: choose “Scheduled cloud flow” and set the parameters according to your actual situation.
    213218-06214.png

    Fill in the judgment conditions:

    formatDateTime(item()['Modified'],'yyyy-MM-dd')
    is equal to
    addDays(utcNow(),-30,'yyyy-MM-dd')
    213283-06215.png

    Then run the flow and you can receive an email as below:
    213166-06216.png

    Thanks,
    Yanli Jiang

    ===========================================

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


3 additional answers

Sort by: Most helpful
  1. Grendall 21 Reputation points
    2022-06-21T12:51:24.167+00:00

    Hi @YanliJiangMSFT-7045

    It did work, but when I am trying to add a dynamic contact email it automatically creates another "apply to each"
    any idea why?
    213406-image.png


  2. Grendall 21 Reputation points
    2022-06-22T14:35:26.367+00:00

    It only works if I enter a manual email in the TO: field it does not work while I try to use the contact email. The "apply to each -> current item" is added by default as soon as I select contact email. If I remove the apply to each then the email is not sent to the "contact email" and the flow runs for several hours. if i leave the apply to each i get an error 213961-image.png FYI same result using outlook 365 send an email V2

    here is a sample of my list:
    213877-image.png

    0 comments No comments

  3. Micca 156 Reputation points
    2022-06-22T16:16:42.277+00:00

    hi

    three thoughts from my end

    1)
    Rather than getting all items and filtering them afterwards I would specify the filter for the modified date directly within the Get items action. You might run in issues long-term with an increasing amount of records in your list.
    To process your desired records only, simply add the following expression within the field for the oData Filter Query.
    Thus, you can opt-out for the additional condition afterwards (or re-purpose it):

    Modified le '@{formatDateTime(addDays(utcNow(),-30,'yyyy-MM-dd'))}'

    213936-image.png

    2)
    It might be that your people picker column allows multiple values. In this case the object returned would include an array and therefor you face the additional 'Apply to each' condition.
    In case you want to stick with one allowed recipient only, you could simply change the column to NOT allow multiple values and the additional 'loop' will not happen.

    If you do not want to touch the column but stick with the first one receiving an e-mail only, you can put the following expression within the TO field
    (First entry of current items Contact field, whose property Email)

    first(item()['Contact'])?['Email']

    213927-image.png

    in case you like the idea of multiple recipients the following approach could fit your needs
    213918-image.png

    3)
    Employees get terminated every now and then and your automation would fail sending the e-mail, as the recipients address is unknown.