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 / Add variable to HTML c...
Power Automate
Unanswered

Add variable to HTML content using Power FX

(1) ShareShare
ReportReport
Posted on by 6

I've been struggling with sending an nicely formatted email using Power Automate Desktop with Power FX enable. I tried different syntaxes in the HTML content but none of them worked. Is it possible? if not, what is the proper way of doing the following:

 

- Get a list

- Loop through list
- Populate the HTML Content <<<< Need help with this

- Send Html content through Email

I have the same question (0)
  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @felyoubi 

     

    I wouldn't recommend using power fx enabled flows for any production/live automation projects as its still in preview stage and lot of limitations as well.

     

    PFB limitations as per Microsoft documentation:

     

    Deenuji_0-1719849973471.png

     

     

    Link - Power Fx in desktop flows (preview) - Power Automate | Microsoft Learn 

     

    In case if you still want to proceed with power fx, please share how your list output looks like and template of your email content and what values you want to include into your template from list?

     

    If possible, share some screenshot of your desktop flow as well so that we will get some idea on this.

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

     

     

  • felyoubi Profile Picture
    6 on at

    Is there a way to disable it?

  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @felyoubi 

     

    There is no on/off switch available in Power Automate Desktop, but you can create a new flow by disabling Power FX.

     

    Please ensure that the Power FX toggle button is turned off while creating your desktop flow (as shown in the screenshot below).

     

    Deenuji_0-1719850222148.png

     

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • felyoubi Profile Picture
    6 on at

    Here are some screenshot of my flow

    felyoubi_0-1719851921927.png

    and data

    felyoubi_2-1719851969701.png

    The html formatting would a standard table with 2 columns, nothing fancy. Once I get the gist of the syntax, I can play with it.

     

    Thank you Deenuji

  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @felyoubi 

     

    Please find the below approach.

     

    I assuming you want to send an email for each row.

     

    Deenuji_0-1719855500410.png

    Deenuji_1-1719855538044.png

     

     

    Code:

    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $fx'C:\\Boot\\Felyoubi.xlsx' Visible: True ReadOnly: False Instance=> ExcelInstance
    Excel.ReadFromExcel.ReadAllCells Instance: $fx'=ExcelInstance' ReadAsText: False FirstLineIsHeader: True RangeValue=> ExcelData
    LOOP FOREACH CurrentItem IN $fx'=ExcelData'
     SET ID TO $fx'=ReadCell(CurrentItem, 1)'
     Display.ShowMessageDialog.ShowMessage Title: $fx'ID' Message: $fx'=ID' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
     SET Number TO $fx'=ReadCell(CurrentItem, 2)'
     Display.ShowMessageDialog.ShowMessage Title: $fx'Number' Message: $fx'=Number' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
     Text.CreateHTMLContent HtmlEditor: $fx'<p>Hi User,</p><p>ID: ${ID}</p><p>Number: ${Number}</p><p><br></p><p>Thanks,</p><p>RPA Bot<br></p>' HtmlContent=> HtmlContent
    END

     

    How to copy/paste the above code into your PAD?

    Deenuji_2-1719855566979.gif

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 957

#2
Valantis Profile Picture

Valantis 847

#3
Haque Profile Picture

Haque 609

Last 30 days Overall leaderboard