Forum Discussion

marionkd's avatar
marionkd
Copper Contributor
Mar 16, 2020
Solved

Flow to notify external users at set time periods of changes to items in a SP library view

I have a lot of external customers who need to be notified when a technical spec changes.  I am looking to store the documents in a SharePoint library 

 

Rather then emailing every time a spec changes, it is possible to

  • Email customers listing all the documents (with a link) that have had changes made in the last fortnight (or whatever time period is specified?

Many thanks

 

  • marionkd  the flow to achieve what you're trying to do is shown below.

     

    The trigger is a Recurrence schedule set to run every 2 weeks on a Friday at 1500 hours.

     

    The first action is a Get past time and I've set that to 14 days.

     

    Next, add a SharePoint Get files (properties only) action and add a filter query of Modified ge '{Past time}'. ge means greater than or equal to, so it's only going to bring back items from the library modified within the last 14 days. Make sure you wrap the Past time expression in single quotes.

     

     

    Next we create the table. Start with a Select control, select value from the dynamic content and then add in the columns you want in your table. Then add a Create HTML table using the output of the Select. Finally we apply a bit of styling to the table using a Compose control and adding in a replace expression:

    replace(body('Create_HTML_table'),'<table>','<table border="1" bgcolor="FDFFBE">')

     

     

    Finally add a Send an Email (v2) action and in the body of the email just select from the dynamic content the output of the Compose where you applied the formatting.

     

     

    The result of the email looks like this:

     

     

    Hope that helps but come back with any questions.

     

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User

4 Replies

  • RobElliott's avatar
    RobElliott
    Silver Contributor

    marionkd  the flow to achieve what you're trying to do is shown below.

     

    The trigger is a Recurrence schedule set to run every 2 weeks on a Friday at 1500 hours.

     

    The first action is a Get past time and I've set that to 14 days.

     

    Next, add a SharePoint Get files (properties only) action and add a filter query of Modified ge '{Past time}'. ge means greater than or equal to, so it's only going to bring back items from the library modified within the last 14 days. Make sure you wrap the Past time expression in single quotes.

     

     

    Next we create the table. Start with a Select control, select value from the dynamic content and then add in the columns you want in your table. Then add a Create HTML table using the output of the Select. Finally we apply a bit of styling to the table using a Compose control and adding in a replace expression:

    replace(body('Create_HTML_table'),'<table>','<table border="1" bgcolor="FDFFBE">')

     

     

    Finally add a Send an Email (v2) action and in the body of the email just select from the dynamic content the output of the Compose where you applied the formatting.

     

     

    The result of the email looks like this:

     

     

    Hope that helps but come back with any questions.

     

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User

    • marionkd's avatar
      marionkd
      Copper Contributor

      RobElliott Thank you so much for this.  Cannot wait to test it out.  Your help is much appreciated

  • Sudharsan K's avatar
    Sudharsan K
    Iron Contributor
    Hi,
    There are 2 ways you can get the information about the changes made to the list or library.
    1. Using Graph API
    Use the below URL on the details of the Graph API method that you can leverage to get the item analytics and based on that you can trigger the email, but this method has to be executed on all the documents and that is very complicated.
    2. Try to create a separate list to store the high level info when a document is modified or created new. You can trigger the flow scheduled at night by retrieving the information from the changes list and send it to the external user.

    Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue
    -Sudharsan K...
    • RobElliott's avatar
      RobElliott
      Silver Contributor

      marionkd Neither of those methods is necessary, it can all be done within a single simple flow that looks at the existing library. I will post the method shortly.

       

      Rob
      Los Gallardos
      Microsoft Power Automate Community Super User

Resources