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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send email with HTML c...
Power Automate
Unanswered

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard