cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dfox
Regular Visitor

Weekly calendar digest

I'm trying to build a Flow that will gather a list of the events on my calendar for the upcoming week, then send me a single email that lists those events in the body. I've found the connectors for everything, but when I start the action for composing the email, Flow sets it as "Compose email for each item." When I run a preview of the flow, it sent me 9 different emails, so I know it is pulling the events out.

 

I need help getting the body composed so that it sends a table, not individual emails for each event.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

HI @dfox,

 

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

 

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 calendar view of events (V2)" action, specify Calendar id, Start Time field set to following formula:

 

utcNow()

End Time set to following formula:

 

 

addDays(utcNow(),7)

Order By field set to following formula:

 

 

Start asc

Note: Within Order By field, type the OData query as above, we could sort calendar events by Start time property in ascending order.

 

  • Add a Variables-> "Initialize variable" action, Name set to EventLists and Value set to empty.
  • Add a "Apply to each", input parameter set to output of "Get calendar view of events (V2)" action.
  • Within "Apply to each" action, add a "Html to text" action, Content field set to Body dynamic content of "Get calendar view of events (V2)" action. 

        Add a "Compose" action, Inputs field set to following json data:9.JPG      Add a "Append to array variable" action, Name set to EventLists variable, Value set to output of "Compose" action.

 

  • Under "Apply to each" action, add a "Create HTML table" action, From field set to EventLists variable.
  • Add a "Send an email" action, Body field set to output of "Create HTML table" action, Is HTML set to Yes.

 

Image reference:10.JPG

 

11.JPG

 

12.JPG

The flow works successfully as below:13.JPG

 

14.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.

View solution in original post

6 REPLIES 6
dfox
Regular Visitor

I was able to get the mechanics done with the following steps.

  1. Use "Get calendar view of events" to pull the events out my calendar
  2. Use the "Compose" connector to create the table inputs of the events using HTML code.
  3. Use the Notifications connector to "Send me an email notification" because it will take the HTML code.

A few of the things I still need to get done are:

- Setting the displayed date properly

- Sort the dates by the start date field

- My event pull is starting a weird time, but that might just be because it is running a preview.

v-xida-msft
Community Support
Community Support

HI @dfox,

 

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

 

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 calendar view of events (V2)" action, specify Calendar id, Start Time field set to following formula:

 

utcNow()

End Time set to following formula:

 

 

addDays(utcNow(),7)

Order By field set to following formula:

 

 

Start asc

Note: Within Order By field, type the OData query as above, we could sort calendar events by Start time property in ascending order.

 

  • Add a Variables-> "Initialize variable" action, Name set to EventLists and Value set to empty.
  • Add a "Apply to each", input parameter set to output of "Get calendar view of events (V2)" action.
  • Within "Apply to each" action, add a "Html to text" action, Content field set to Body dynamic content of "Get calendar view of events (V2)" action. 

        Add a "Compose" action, Inputs field set to following json data:9.JPG      Add a "Append to array variable" action, Name set to EventLists variable, Value set to output of "Compose" action.

 

  • Under "Apply to each" action, add a "Create HTML table" action, From field set to EventLists variable.
  • Add a "Send an email" action, Body field set to output of "Create HTML table" action, Is HTML set to Yes.

 

Image reference:10.JPG

 

11.JPG

 

12.JPG

The flow works successfully as below:13.JPG

 

14.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.

View solution in original post

Kris,

You hit almost all my checkmarks except for formatting the date/time. Not knowing where you are at, I'm not sure if the start & end times in your picture are UTC or your personal time zone. But your flow produces a result that is much more elegant than mine! I'll definitely be reproducing yours. Below are the screenshots of my flow, which has not actually run other than my preview (the first instance is set for this Sunday).

 

It is set to run each Sunday at 2pm in my time zone.

no1 Recurrance.PNG

 

I used the first version of the "Get calendar view of events" to do the data pull.

no2 Calendar event pull.PNG

 

I used another weekly digest flow as a template to build HTML rows for a table.

no3 Compose.PNG

 

I finish with the notification action to send me an email, and the body of the email creates a table from the "Apply to each" step, with the expression join(outputs('Compose'),'')

no4 Email.PNG

 

I end up with the following results. As you can see, the events aren't actually sorted, either alphabetically or starting team.

no5 results.PNG

 

Thanks again for taking some time with this!

Donovan 

dfox
Regular Visitor

@v-xida-msft, I've tried recreating your flow, and I keep running into an error when it gets to creating the HTML table.

 

Capture.PNG

Any suggestions?

Anonymous
Not applicable

@v-xida-msft I've got the same error. When I try to specify the number of columns it puts the 'Create HTML Table' into another 'Apply to each' and then emails me a separate email for each calendar entry.

 

Thanks

Hannah

@v-xida-msft @dfox 

This worked a dream for me except all returns have been removed through the HTML to text convert. Is there anyway to stop this from happening?

 Original event:

property 1.PNG

 

Table output in email:

property 2.PNG

 

My Flow is exactly as you've demonstrated.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,460)