cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
MrtnM Helper V
Helper V

Monthly email with info about new items in SP list

Well, the title says it all: 

I want to create a flow that sends an email (kind of a "newsletter") with a table containing information from two or three custom columns in a Sharpoint online list (probably "summary" text column and "created by"), for all the items created the past month.

 

My problem is, I do not understand how to manage

  1. how to collect the items (I suppose Filter array is the thing to use, but I am a total noob on coding, so ...)
  2. how to put them into the (html) email.

All suggestions are welcome and appreciated!

 

This is what I've created ... I think it's a start, but not more than that.

Namnlöst-1.jpg

 

 

 

7 REPLIES 7
Dual Super User
Dual Super User

Re: Monthly email with info about new items in SP list

Hi

I assume "Hamta objekten" equals to "Sharepoint Get Items", also FilterMatris equals to "Filter Array".

If so, you need to fill the condition inside Filter Array, just to get the items you are interested in. I guess you can take as reference the content of "Created" Date and Time and remove items older than one month.

Once filtered, there is an acton block that helps you to build an HTML table. Once built, you can add the corresponding action block to send an email (Office 365 Outlook Outlook, gmail, etc.) Please note in this last step you shall add the HTML table to the body and mark option IsHTML? to Yes.

 

There is a great tutorial published on Microsoft Flow official Blog explaining a very similar scenario.

https://flow.microsoft.com/en-us/blog/email-digest-date-manipulations/

 

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



MrtnM Helper V
Helper V

Re: Monthly email with info about new items in SP list

Thanks! I will look into that and hope I understand it 🙂

Dual Super User
Dual Super User

Re: Monthly email with info about new items in SP list

Hi again

Also @v-yamao-msft has provided vary vauable feedback in this thread 

https://powerusers.microsoft.com/t5/Building-Flows/Get-Items-and-then-Send-Email/m-p/76824#M7603

 

In the thread you will see detailed a condition that compares "Created" date from SP item with Today. So, "Created" can be used for date comparisons.

Happy Flowing!

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Community Support
Community Support

Re: Monthly email with info about new items in SP list

Hi @MrtnM,

 

Do you want to use Filter array action to filter all the items created the past month?

Further, do you want to save the collected items as a html table?

 

I have made a test on my side and please take a try with the following workaround:

  • Add a proper trigger, here I use Recurrence trigger.
  • Add a “Get items” action, specify Site Address and List Name.
  • Add a Filter array action, From set to output of “Get items” action, click “Edit in advanced mode”, type the following formula:

 

@greaterOrEquals(formatDateTime(item()?['Created'], 'MM/dd/yyyy'), formatDateTime(addDays(utcNow(), -31), 'MM/dd/yyyy'))

 

  • Add a “Select” action, From set to output of “Filter array” action, within Map entry, first Enter key box set to Course Title text, right Enter value box set to following formula:

 

item()?[‘Course_x0020_Title’]

 

Second Enter key box set to Course Code text, right Enter value box set to following formula:

item()?[‘Course_x0020_Code’]

Third Enter key box set to Created text, right Enter value box set to following formula:

item()?[‘Created’]
  • Add a “Create HTML table” action, From set to output of “Select” action.
  • Add a “Send an email” action, Body set to output of “Create HTML table” action.

Note: "Course Title", "Course Code" and "Created" are all columns of SharePoint list.

 

Image reference:7.jpg

 

8.jpg

The flow works successfully as below:11.JPG

 

10.JPG

 

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.
MrtnM Helper V
Helper V

Re: Monthly email with info about new items in SP list

Thanks, that was a nice guide to follow 🙂

It works perfect (almost - I have an isssue with the html table, since it insists on showing input from an alternatives column like this in the email:  value.jpg

MrtnM Helper V
Helper V

Re: Monthly email with info about new items in SP list

Well ... sorry, no, it doesn't really work. It sends one email with a html table per new item, instead of creating a html table with all items. Somewhere I have made a mistake.

I know my Flow doesn't look exactly like the one v-xida-msft created, but the Flow created an "Apply to each" by itself. Maybe that's the error - but how do I avoid it?

In the Run history, the run is marked as succesful. The Filter array action indata displays all items, but the outdata only displays one (the oldest). But two e-mails are sent, one for each item.

 

 

flow2.jpg

MrtnM Helper V
Helper V

Re: Monthly email with info about new items in SP list

Hi again,

I have paused this for a long time, but now it is time to get it working.

Something is clearly wrong, the html table in my e-mail just contains the formula from the "Select" action.

But I cant't find the error.

Thankful for all the help I can get.

 

Namnlöst-5.jpg

Namnlöst-7.jpg

Helpful resources

Announcements
Did you attend MBAS? Claim your badge

Attending MBAS? Claim your badge

Whether you’ve streamed the digital event live, or you're watching on-demand, claim your attendee badge to sport on your profile.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (6,007)