cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
clarapfm
Helper I
Helper I

Weekly Calendar Digest Flow not sending if blank & formatting

I've put together a flow to automatically generate an email of all events coming in the next week. I have two problems I would like to sort out.

 

First, when I do have events in the upcoming week, the table looks like this:

Screen Shot 2019-11-13 at 11.55.28 AM.png

 

How do I add space/padding around the cells of the table, and/or a border, to make the events easier to read as separate from one another?

 

 

 

Second, when there are no upcoming events in the week, I receive an email that looks like this:

Screen Shot 2019-11-13 at 11.07.39 AM.png

 

How do I prevent the email from sending if there are no upcoming events?

 

 

 

Here is the current layout of my flow:

 

Screen Shot 2019-11-13 at 12.01.33 PM.pngScreen Shot 2019-11-13 at 12.02.43 PM.png

Screen Shot 2019-11-13 at 12.02.55 PM.pngScreen Shot 2019-11-13 at 12.03.09 PM.png

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
AlanPs1
Resident Rockstar
Resident Rockstar

Hi @clarapfm 

Try this code: 

lenght(body('Get_calendar_view_of_events_(V3)')?['value'])

capture-457.PNG

 

If you find my posts helpful, please mark with thumbs up

 

If this solves your issue, please click "Accept as Solution"

 

Any questions, just ask.

 

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


View solution in original post

3 REPLIES 3
AlanPs1
Resident Rockstar
Resident Rockstar

Hi @clarapfm 

Firstly, regards spacing around your table, think HTML, not Flow as such.

You need to add some styling to your table in the head area of an HTML email. There are several posts in the forum demonstrating this but please consider something like the below

<html>
<head>
<style>
body {
	font-family: "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;
	color: rgb(51, 51, 51);
	background-color: #fff;
}

table {
	font-family: "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;
	font-size: 14px;
	border-collapse: collapse;
	width: 90%;
	text-align: center;
}

td {
	padding: 5px;
}

th {
	padding-top: 8px;
	padding-bottom: 8px;
	padding-left: 8px;
	padding-right: 8px;
}

</style>
</head>
<body>
<table style="width:100%">
  <tr>
    <th>Firstname</th>
    <th>Lastname</th>
    <th>Age</th>
  </tr>
  <tr>
    <td>Jill</td>
    <td>Smith</td>
    <td>50</td>
  </tr>
  <tr>
    <td>Eve</td>
    <td>Jackson</td>
    <td>94</td>
  </tr>
</table>
</body>
</html>

Secondly, have a look at the lenght() function.

If you add a condition to check the length of your "Get calendar view of events". 

 

If length is greater than zero, move on to create your table and send the email. If it is zero, no need to send the email or send a different email that says:

 

"No calendar events this week"

 

If you find my posts helpful, please mark with thumbs up

 

If this solves your issue, please click "Accept as Solution"

 

Any questions, just ask.

 

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


clarapfm
Helper I
Helper I

@AlanPs1 Thank you! The HTML formatting worked wonders.

 

I'm having some trouble with the length() function. I tried using it within a condition, but it causes the flow to fail.

 

Here's what I have (the length() function I am using within the condition is length(0) ) :

Screen Shot 2019-11-13 at 2.16.45 PM.png

 

 

Any insight on how I can fix this?

AlanPs1
Resident Rockstar
Resident Rockstar

Hi @clarapfm 

Try this code: 

lenght(body('Get_calendar_view_of_events_(V3)')?['value'])

capture-457.PNG

 

If you find my posts helpful, please mark with thumbs up

 

If this solves your issue, please click "Accept as Solution"

 

Any questions, just ask.

 

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

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

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (5,150)