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 / How to concatenate HTM...
Power Automate
Answered

How to concatenate HTML if Approval Response variable has text?

(0) ShareShare
ReportReport
Posted on by 299

I am using the "Start and wait for an approval" connector within my custom flow.  I am also adding a response variable inside an send mail v2 connector, so that any responses from the approver get sent to the submitter who filled out the form.  But I would like to concatenate HTML before the response, only if there's a response from the approver.  Is this possible to setup a condition like this from within Power Automate?

 

Something like this 

 

(if there is a response from the approver)

<p>the part before the response</p>

The actual response

 

 

Categories:
I have the same question (0)
  • Verified answer
    Rahber Profile Picture
    1,935 on at

    Initialize a variable and then in the condition of approvals you can add text to that variable and the outcome variable only if there was a response. If the response is no the variable will still be empty as i initialized it as empty

     

    Please see the image below

    Capture.PNG

    Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

    Thanks,
    Rahber

  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    Hello @kensley 

     

    Yes you can use an IF expression right inside the email.

    Try:

    if(equals(empty(<Your Response>)),true,’ ‘,’the part before the response’)

     

    this expression is saying: if the response is empty put nothing, if the response is NOT empty put the part before the response.

     

    please note the 2 single quotes after true, do not need to have a space in between. But I added a space to be easily read on this post.

  • CU09091757-0 Profile Picture
    299 on at

    @Jcook, many many thanks on that example you provided. Where can I go to learn how to do what you just did, but for variables? Where can I learn the syntax? I'm trying to get a variable into an if condition, as an expression, for the body of my email. But I feel that I am failing because every time I run my flow, it causes an error.

     

    For example, this fails me:

    if(equals(empty(variables('approver_comment'))),true,'','<h2>A message by the Approver</h2>')

     

     

    Thanks for any tips on variable usage!

  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    @kensley 

     

    What error are you seeing?

  • CU09091757-0 Profile Picture
    299 on at

    Thanks for the help! When I put the following code into my expression field, and click "ok" to then add it into the body area of my "Send an email V2" Connector...

     

     

    if(equals(empty(variables('approver_comment'))),true,'','<h2>A message by the Approver</h2>')

     

     

    PA complains before sending that e-mail out and says....

     

     Unable to process template language expressions in action 'Accept_-_Send_an_email_(V2)_-_Requester' inputs at line '1' and column '48999': 'The template language function 'if' expects three parameter: the condition to test as the first parameter, the value to return if the condition is true as the second parameter, and the value to return if the condition is false as the third parameter. The function was invoked with '4' parameter(s). Please see https://aka.ms/logicexpressions#if for usage details.'.

     

    Sorry for any bonehead mistakes I'm making.

  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    Hi @kensley 

     

    Sorry but could you post a screenshot of the expression inside the email action?

  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    @kensley 

     

    Sorry.. That is my fault.

    The correct expression would be:

    if(empty(variables('approver_comment')),'','<h2>A message by the Approver</h2>')

    Since empty() returns true if the value is empty. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 86 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 55

#3
Ellis Karim Profile Picture

Ellis Karim 53 Super User 2026 Season 1

Last 30 days Overall leaderboard