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 / Getting form data resp...
Power Automate
Answered

Getting form data responses into a html code in ‘initiate variable’

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I have a flow that uses the action ‘initiate variable’ with the type as string and value as a custom HTML for the body of an email. Then inside ‘send email v2’ in the body box, I have a tag that points to the variable and displays the custom HTML code when the email is sent. - this works really well.

 

However, in another flow, when trying to replicate the same flow, I hit an error because I cannot use the ‘initiate variable’ because there is a series of actions within an ‘apply to all’ action. As the command for a variable has to be top level, this means I cannot use dynamic content which is taken from within the apply to all action.

 

What I am trying to achieve is to have html code, with dynamic content (form responses) within it. The standard text editor inside the send email v2 does not like html tags with designs in it, even when switching to code view. I would appreciate any help on this topic.

 

Images below are from my flow that works correctly. 

Categories:
I have the same question (0)
  • Verified answer
    David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at

    Initialize the variable outside of the apply to each as indicated. Then in your other flow use the Set variable action to set the custom HTML. Although if you're doing what I think you are doing, just use a Compose action to do this and put the output of the compose action in your e-mail.

  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    @Greenybfc 

    Rather than assigning a specific value in the Initialize action, consider initializing the variable as blank and use the Set variable action within your Apply to Each loop to dynamically set the HTML content. 

     

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard