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 / 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,204 Super User 2025 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
    Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 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
    Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 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

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