web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Answered

'Body' Syntax Error

(0) ShareShare
ReportReport
Posted on by 15

I am using Power Automate (PA) Desktop and am performing a simple mail merge using data from an excel spreadsheet.  After defining my variables (from Excel), I use the "Send email message through Outlook" item.  To allow formatting, I have written the body of the email in html.  When the body includes the html shown immediately below in blue italicized text, PA finds no errors and executes the flow as expected. 

"<p>Good Evening %name%,</p>
<p>As of the end of this week (end of the day on Wednesday), your week at a glance stats show you have:</p>
<ul><li><span style="color: #000000;"><strong>%nstudents%</strong></span> students active</li>
<li><span style="color: #000000;"><strong>%nars%</strong></span> at-risk students</li>
<li><span style="color: #000000;"><strong>%narn%</strong></span> at-risk notes submitted</li>
<li><span style="color: #ba372a;"><strong>%narnn%</strong></span> at-risk notes needing to be submitted still</li>
<li><span style="color: #000000;"><strong>%nua%</strong></span> unsubmitted assignments (across all your courses)</li>
<li><span style="color: #ba372a;"><strong>%nlgar%</strong></span> late-graded assignments (0 is the goal)</li>
<li><span style="color: #000000;"><strong>%nannoun%</strong></span> course announcements made within the past week</li>
<li><strong><span style="color: #ba372a;">%nannounneeded%</span></strong> course announcements that needed to have been made last week (1 per course per week is the goal)</li>
<li><span style="color: #000000;"><strong>%ndslcacc%</strong></span> day(s) since your last canvas access</li>
<li><span style="color: #000000;"><strong>%ndslcactive%</strong></span> day(s) since your last canvas activity</li>
<p>Attached is a copy of the excel file containing the details behind your weekly stats.&nbsp; If you have any questions or need anything, please never hesitate to let me know!</p>
<p>Sincerely,</p>"

However, when the body is modified by adding one more list item (colored in red, bold text below), PA gives a syntax error just below the "Body" field of the "Send email message through Outlook" item.  

"<p>Good Evening %name%,</p>
<p>As of the end of this week (end of the day on Wednesday), your week at a glance stats show you have:</p>
<ul><li><span style="color: #000000;"><strong>%nstudents%</strong></span> students active</li>
<li><span style="color: #000000;"><strong>%nars%</strong></span> at-risk students</li>
<li><span style="color: #000000;"><strong>%narn%</strong></span> at-risk notes submitted</li>
<li><span style="color: #ba372a;"><strong>%narnn%</strong></span> at-risk notes needing to be submitted still</li>
<li><span style="color: #000000;"><strong>%nua%</strong></span> unsubmitted assignments (across all your courses)</li>
<li><span style="color: #ba372a;"><strong>%nlgar%</strong></span> late-graded assignments (0 is the goal)</li>
<li><span style="color: #000000;"><strong>%nannoun%</strong></span> course announcements made within the past week</li>
<li><strong><span style="color: #ba372a;">%nannounneeded%</span></strong> course announcements that needed to have been made last week (1 per course per week is the goal)</li>
<li><span style="color: #000000;"><strong>%ndslcacc%</strong></span> day(s) since your last canvas access</li>
<li><span style="color: #000000;"><strong>%ndslcactive%</strong></span> day(s) since your last canvas activity</li>
<li>Courses with average student score below 80% is/are: <strong>%lcs%</strong>.(None is the goal).</li></ul>
<p>Attached is a copy of the excel file containing the details behind your weekly stats.&nbsp; If you have any questions or need anything, please never hesitate to let me know!</p>
<p>Sincerely,</p>"

I thought perhaps the variable was the problem.  Even if I remove the<strong>%lcs%</strong> excerpt, I still receive the error.  Because the error is present, I cannot run the flow.  If one of you have a moment to spare, may I ask if you can share some insight?

Thank you very, very much for your time.

-matt

 

I have the same question (0)
  • Verified answer
    VJR Profile Picture
    7,635 on at

    Hi @MB-HealthSci 

     

    The problem appears to be because of the percent sign in 80% which is getting conflicted with the percent sign of PAD variables.

     

    Add another percent sign by changing it as follows:

     

    <li>Courses with average student score below 80%% is/are: <strong>%lcs%</strong>.(None is the goal).</li>

     

     

  • MB-HealthSci Profile Picture
    15 on at

    Thank you so much @VJR for the accurate and speedy fix!  This, indeed, resolved the body syntax error.  

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 276 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard