cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AmyBabinchak
Level: Powered On

Email a list of items older than 30 days

We have a  list in sharepoint which tracks quotes through the purchase. I'm trying to create a flow that emails a list of quotes that are older than 30 days. I've got the delay for 30 days (picked here from another thread) now for those that it has found to be older than 30 days how do I get it to insert the list it has found into an email?

 

Here's where I'm at so far. I think I need a condition placed before that Yes email. Suggestions?

 

Emailoldquotelist.JPG

3 REPLIES 3
Highlighted
Community Support Team
Community Support Team

Re: Email a list of items older than 30 days

Hi @AmyBabinchak,

 

Could you please share a full screenshot of your flow's configuration?

Could you please show more details about your SharePoint list?

 

If you want to insert a list of quotes which are older than 30 days into an email, I think the "Create HTML table" action could achieve your needs. I have created a SharePoint list on my side and the data structure of it as below:19.JPG

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

  • Add a proper trigger, here I use Flow Button 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:
@lessOrEquals(formatDateTime(addDays(item()?['Created'], 30), 'MM/dd/yyyy'), utcNow('MM/dd/yyyy'))
  • Add a "Select" action, From set to output of "Filter array" action, Within Map entry, type three entries as below:20.JPGThe corresponding value of first entry set to following formula:
    item()?['Subject']

         The corresponding value of second entry set to following formula:

item()?['Course_x0020_Code']

        The corresponding value of third entry set to following formula:

item()?['Course_x0020_Title']

Note: Use this action to select which columns of your SharePoint list to be displayed within your email. On your side, you should type the following formula to reference your SharePoint list column value:

item()?['ColumnNameOfYourSharePointList']

If there is a space within your column name, please replace the space with '_x0020_' within above formula.

 

  • Add a "Create HTML table" action, From set to output of "Select" action, Include Headers set to yes.
  • Add a "Send an email" action, Body field set to output of "Create HTML table" action. The Is HTML field set to Yes.

Image reference:21.JPG

 

22.JPG

The flow works successfully as below:23.JPG

 

24.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.
AmyBabinchak
Level: Powered On

Re: Email a list of items older than 30 days

Kris,

 

Thanks for all of the details. I'm going to give this a go today and will post back. My regular expression skills are weak. Do you happen to know a good source for getting some training on them?

AmyBabinchak
Level: Powered On

Re: Email a list of items older than 30 days

Well I gave it a try and generated a 100 emails instead of 1. (sigh) The problem I have is that as soon as I add my column to the Select table helpful Flow automatically stuffs it into a For Each container. Here's what I've got and a sample of the list I'm working with. 

 

In the end I want the HTML output in the email to have just the Customer and Invoice # fields in it. And only those where the Settled column is No and the date created was more than 30 days ago. 

 

Some photos:

 

 

 

list.JPGFilter.JPG

applytoeach.JPG

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 237 members 4,383 guests
Please welcome our newest community members: