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!


View solution in original post

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.

Top Solution Authors
Users online (1,393)