Skip to main content

Notifications

Community site session details

Community site session details

Session Id :

Generate Weekly Report from SharePoint List

rsaikrishna Profile Picture Posted by rsaikrishna 3,703

Use Case: Send a weekly report of SharePoint list information to specific users

 

SharePoint List:

rsaikrishna_0-1598001692263.png

 

Column Name Data Type
First Name Single line of Text
Last Name Single line of Text
OrderNo Number
Product Single line of Text
Quantity Number
OrderTotal Number
OrderStatus Single line of Text
OrderDate Date and Time

 

Weekly Report:

Prepared a spread sheet (Excel file with extension .xlsx) with all the required columns with sample data and formatted as an excel table. Now, stored the excel file in the Documents library. 

1.JPG

 

Flow at high level view (collapsed view):

7.JPG

Used "Scope" action to consolidate actions as sections for easy understanding. Also, we can use exception handling easily with Scopes. 

 

Here is the details view of the flow:

 

Step 1: Flow Trigger

The flow trigger is a recurrence schedule. The flow runs on every Sunday morning (only once in a week)

2.JPG

 

Step 2: Get product orders created from last 7 days

The above action "Get Items" will retrieve all the product orders which were created from last 7 days from today.

3.JPG

 

 

Filter Query:
OrderDate gt 'addDays(utcNow(),-7)'

 

Note: Insert the above expression from expression pop up dialog box.

 

Step 3: Clean Weekly Report Spreadsheet in the document library

 

In this step, performing following steps:

1. Accessing the Excel table by using "List rows present in a table" action. 

2. Checking if the table has any rows with following expression:    

 

length(body('List_rows_present_in_a_table')?['value']) is not equal to 0

 

3. Deleting each row from excel table.

 

4.JPG

 

Step 4: Generate Weekly Report

 

Now, adding every single product order item which I received with Get Items action to the spread sheet. Mapped the columns in the spread sheet with the columns in the SharePoint list Product Orders.

 

5.JPG

 

Step 5:  Send email with weekly status report as attachment

 

By using "Get file content" action, I am getting the weekly spread sheet content and sent it as an attachment to the specific users.

 

 

6.JPG

Important Note:

Attachments Name - 1 field in the above screen shot contains the file name. We MUST include file extension as .xlsx. Otherwise, the flow will send the email with attachment with no extension. 

 

I hope the above post will help to address your requirement.

 

Regards

Krishna Rachakonda

Categories:

Comments

  • arunkumar1976 Profile Picture arunkumar1976 9
    Posted at
    Generate Weekly Report from SharePoint List

    This tutorial was great. It helped me create a report.

     

    However, there appears to be an issue when I try and open the file. I always get a message that the file is corrupt. I tried other options like base64 but it did not succeed. Not sure where the issue lies.

     

    Any suggestions?

  • johnsonrflows Profile Picture johnsonrflows
    Posted at
    Generate Weekly Report from SharePoint List

    Thank you for the vlog. It was very helpful.

     

    I have a question and hopeful you can help. So the data that I am pulling, sometimes is not update within a week time. How can I add a condition that if the new excel file has no data this week. The stakeholders does not receive an email (prefer no email option) or  send a different email stating that no updates were made this past week? 

    johnsonrflows_0-1664826539419.png

     

     

  • laksh Profile Picture laksh
    Posted at
    Generate Weekly Report from SharePoint List

    Hi,

    Thank you explanation. But why not mentioned "Delay" used in "Step 4: Generate Weekly Report" . it's also very important for this automate for in case of SharePoint data was big.

    anyway i took two day for find this mistake in my automate lol.....

  • takolota1 Profile Picture takolota1 4,894 Super User 2025 Season 1
    Posted at
    Generate Weekly Report from SharePoint List

    @rsaikrishna 


    If you or anyone else have a much larger report to automate like this, you may want to check out the new Excel batch actions I created:

     

    Excel batch update, create, & upsert:

    https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Excel-Batch-Create-Update-and-Upsert/m-p/1624706

     

    Demo video:

    https://youtu.be/HiEU34Ix5gA

     

    Excel batch delete:

    https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Excel-Batch-Delete/m-p/1634375#M735

  • takolota1 Profile Picture takolota1 4,894 Super User 2025 Season 1
    Posted at
    Generate Weekly Report from SharePoint List

    @rsaikrishna 


    If you or anyone else have a much larger report to automate like this, you may want to check out the new Excel batch actions I created:

     

    Excel batch update, create, & upsert:

    https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Excel-Batch-Create-Update-and-Upsert/m-p/1624706

     

    Demo video:

    https://youtu.be/HiEU34Ix5gA

     

    Excel batch delete:

    https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Excel-Batch-Delete/m-p/1634375#M735

  • avinashm15 Profile Picture avinashm15 2
    Posted at
    Generate Weekly Report from SharePoint List

    Hi,

    I have created flow for Power Bi tables using power automate, in which on click it will send table in csv format as attachment to intended receiver.

    Here i want one help, i have many rows in table but i want summary (or can say pivot on first level) of that table in the mail body, i tried to mentioned by SELECT option but each row is getting in mail body.

     

    Can you please help.

     

     

  • jm_herard Profile Picture jm_herard
    Posted at
    Generate Weekly Report from SharePoint List

    Hello and thank you for the tutorial.

    Generate Weekly Report step is grouping 2 actions. 
    Search for Scope in Add an Action

    Hope this helps

  • MGD Profile Picture MGD
    Posted at
    Generate Weekly Report from SharePoint List

    Hi iamcstevenson

     

    Thank you for the feedback. I was not able to add the scope section which i have been able to do with your help thanks. Now in step 3 how do i create a sharepoint site 

  • iamcstevenson Profile Picture iamcstevenson 50
    Posted at
    Generate Weekly Report from SharePoint List

    I got hung up a little bit here too.  Were you able to add a SCOPE section as a first step? 

    iamcstevenson_0-1619202380432.png

     

    After that, then you can ADD AN ACTION  to get to Delete a Row.  Make sure you choose Excel and not Dataverse.

     

    iamcstevenson_1-1619202477395.png

     

     

  • MGD Profile Picture MGD
    Posted at
    Generate Weekly Report from SharePoint List

    Hi 

     

    I am new to power automate and am failing to get dynamic content to appear in step 2. how do i create a sharepoint site in step 3