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 / No reconoce la variabl...
Power Automate
Suggested Answer

No reconoce la variable de flujo dentro de un Script

(1) ShareShare
ReportReport
Posted on by 6
Buenos días, estoy realizando un flujo de escritorio en el cual creo un contenido HTML en la variable "HtmlContent2" y luego utilizo esa variable dentro de un script. El script que crear un nuevo correo y me lo muestre en pantalla para enviarlo manualmente. Pero no me genera el contenido HTML en el cuerpo del correo.
 
 
Me genera el siguiente error:
 
I have the same question (0)
  • Suggested answer
    eetuRobo Profile Picture
    4,583 Super User 2026 Season 2 on at
    Can you show your full script? Especially the line 9. Your ScriptError says there is an error in line 9 position 21.


    Make sure you have End With at the end of your With -statement.
    Like so:

  • CU26110431-0 Profile Picture
    6 on at
    Verifique el script en la línea 9 como indican e hice algunas pruebas.
     
     
    Si bien el script se ejecuta sin errores , el contenido HTML de la variable "HtmlContent2" no se muestra en el cuerpo del correo generado.
     
  • Suggested answer
    CU16071609-1 Profile Picture
    6,255 Moderator on at
    Hi ,
     
    It appears that you've created a variable named Htmlcontent2 but did not pass it correctly in VBScript.
     
    Please refer to the screenshot below where I have generated some HTML content using "Create HTML Content" This content is saved in the "Htmlcontent" variable, which I have also passed to VBScript, and it is functioning properly.
     
     
     
    VBScript for your reference:
    ' Create a new Outlook email and display it for manual sending
    Set olApp = CreateObject("Outlook.Application")
    Set olMail = olApp.CreateItem(0)
    
    With olMail
        .Subject = "Subject of the Email" ' Set the email subject
        .To = "recipient@example.com" ' Set the recipient email address
        .Cc = "ccrecipient@example.com" ' Set the CC recipient (optional)
        .Bcc = "bccrecipient@example.com" ' Set the BCC recipient (optional)
        .Body = "%HtmlContent%" ' Set the email body
        .Display ' Display the email for manual sending
    End With
    
    ' Release the objects
    Set olMail = Nothing
    Set olApp = Nothing
     
     
     
    Thanks,
    Deenuji Loganathan 👩‍💻
    Power Automate Desktop Community Champion 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and like my suggestion ❤️  Your feedback supports future seekers 🚀
  • CU26110431-0 Profile Picture
    6 on at
    Hola de nuevo
     
    Replique los mismos pasos que me indicaron, pero no funciona, sigue saliendo error
     y no genera el correo.
     
    Resultado
  • Suggested answer
    CU16071609-1 Profile Picture
    6,255 Moderator on at
    Hi,
     
    It looks really weird; how come it's working for me but the same code isn't working for you?
     
    Let's troubleshoot together. First, remove the HtmlContent variable and hardcode some values to see if it works normally.
     
    If you're still unable to fix this, please connect with me on LinkedIn.
     
    Thanks,
    Deenuji Loganathan 👩‍💻
    Power Automate Desktop Community Champion 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and like my suggestion ❤️  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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 247 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 164 Super User 2026 Season 2

#3
trice602 Profile Picture

trice602 138 Super User 2026 Season 2

Last 30 days Overall leaderboard