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 Platform Community / Forums / Power Automate / Send email with HTML c...
Power Automate
Answered

Send email with HTML conditional text based on SP list values

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

I'm trying to build a flow which will generate an email based on the values from SP list.

 

The email is using HTML and there are a few bullet point which should be present in the email body or not present based on the value of the respective SP list column. If the value is Yes, show the bullet point text, if the value is not, just not show it at all.

 

My idea was to use something like this (example for SP list column called QA Module):

if(equals(@{triggerOutputs()?['body/field_36/Value']},'Yes','<li>Q&amp;A</li>'))

but that doesn't work.

 

All four SP list column I'm getting the data from are Choice type columns with Yes and No values available.

 

Any idea how should the correct expression look like?

Categories:
I have the same question (0)
  • Verified answer
    Caspar_Rubin Profile Picture
    831 on at

    Hey,

     

    I would create two new variables (action: initialize variable) called something like "HTMLcode" and "EmptyString", both have the type "string" and no content at the moment.

    Then get the SharePoint Items and check if the value in the column is true or not (action: condition with expression "true").

     

    If true, I then add the HTML content to the "HTMLcode" variable. (action: Set Variable")

     

    Then put the variable HTMLcode in the email. Depending on if the value in the list is true or not, there will be content in the "HTMLcode" variable or not.

     

    Don't forget to reset/clean-up the variable after the email is sent. So it's empty again before the next check if you have multiple SharePoint List items looping... This step can be skipped if the flow runs only for 1 SharePoint item.

     

    dependedHTML_2.png

     

     

     

     

  • xsomej33 Profile Picture
    on at

    Works great, thanks @Caspar_Rubin!

    Since I have 4 conditions in my solutions, I'm simply appending each of them to the string variable and displaying that variable in the final email.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 419

#2
Vish WR Profile Picture

Vish WR 314

#3
David_MA Profile Picture

David_MA 260 Super User 2026 Season 1

Last 30 days Overall leaderboard