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 / Problem with variables...
Power Automate
Unanswered

Problem with variables and "Execute Javascript on Webpage action"

(0) ShareShare
ReportReport
Posted on by 69

Hi everyone!

 

I'm going through a really rough time trying to understand how to properly use the "Execute Javascript on Webpage" action.

 

I have a few variables in my flow, that will come from a cloud flow. Nevertheless, I'm testing it with default values.

 

The variables are:

  • %String1%
    • Type: Text;
    • Value: ABCDEFG.
  • %Name%
    • Type: Text;
    • Value: Lorem Ipsum;
  • %Rate%
    • Type: Number;
    • Value 1,50

I have got 3 simple "Execute Javascript on Webpage" action, with only console.logs to identify each one, and a console.log(%variable here%).

 

Although, with both string variables, it seems the code block does not run at all.

 

With the number variable, it did run, but it logged the variable value as "1 50", which I assume might be a locale issue because of the decimal separator.

 

I need the text variables because I need to use them in some input fields of the page, but I can't achieve it since it apparently does not even run.

Does anyone know how to solve this?

  • RomuloL Profile Picture
    2 on at

    Hi,

    You could try passing parameters into the javascript function. In the image I attached there is an example that worked for me.

    explicacao_variavel_funcao_js_1.png

    explicacao_variavel_funcao_js_2.png

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    console.log() does not do anything in PAD, as you're not running this in the context of the JS console. Use "return" instead of console.log() in your function to return output.

     

    If you shared your JS function, I could be a bit more specific as to how to use it.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

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

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 445

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 300

Last 30 days Overall leaderboard