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
All suggestions are welcome and appreciated!
This is what I've created ... I think it's a start, but not more than that.
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.
Hope this helps
Also @v-yamao-msft has provided vary vauable feedback in this thread
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.
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:
@greaterOrEquals(formatDateTime(item()?['Created'], 'MM/dd/yyyy'), formatDateTime(addDays(utcNow(), -31), 'MM/dd/yyyy'))
Second Enter key box set to Course Code text, right Enter value box set to following formula:
Third Enter key box set to Created text, right Enter value box set to following formula:
Note: "Course Title", "Course Code" and "Created" are all columns of SharePoint list.
The flow works successfully as below:
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:
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.
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.