Export a list to excel and send as attachment in email notification

  • 17 June 2021
  • 4 replies
  • 574 views

Hello, 
I'm using Nintex for SharePoint 2016 to create a workflow to automatically send an email weekly to a group of people if certain field are set to something.

 
Here's what I my flow looks like, 

    If Certified is equal to 'No' AND Owner is blank

    Export the list to excel

    Attach the excel to the email notification, send it to the managers

I need help on exporting the list and attaching it to the email. Can some please help. It will be greatly appreciated. Thanks in advance. 


4 replies

Userlevel 3
Badge +12

Nintex does not provide an option to export the list to excel, instead, use a PowerShell script that performs this job, and automate this script running using a schdule task.

Thank you.
Badge +12

@MykeeLee try below approach:


 



  1. Query your list to get all the data you need and store them in a collection. Also get the ID column.

  2. Now using for loop, ID collection and Index variable (for each ID):

    1. Using collection operations for each collection and using index variable get the value 

    2. using build string build action and each values from each collection create the CSV string and each row



  3. Using Web Request and above string, create the CSV file and store it in a document library.

  4. Create a workflow to send email notification when new document gets created and make sure you attach the document in the email notification too.

Thank you for all your help and responses. We've decide to create a view in SharePoint and include a link to the view vs. exporting into excel.

Reply