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 / Run Javascript functio...
Power Automate
Answered

Run Javascript function on web on page

(0) ShareShare
ReportReport
Posted on by 48

YeuHarng_0-1693299893027.png

YeuHarng_1-1693300046710.png

 

hi, i have a problem on using javascript to get data on web page, in web page i can get all data, but why when i run in powerautomate ,the data i can't save in the variable, any solution? thx for help. 

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    There is no console to log the text to. Instead of console.log, use return. That should return the value to the variable.

    -------------------------------------------------------------------------

    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.

     

  • YeuHarng Profile Picture
    48 on at

    YeuHarng_0-1693310399039.png

    YeuHarng_1-1693310409976.png

    yes i have try this before but just can get the last data

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You should do it outside the loop and return names instead of name.

    Just like you did with console.log in your previous message.

    -------------------------------------------------------------------------

    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.

     

  • YeuHarng Profile Picture
    48 on at

    YeuHarng_0-1693313467478.png

    YeuHarng_1-1693313474707.png

    this time results is object

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Well, that is because you are not appending anything to names. I'm not sure why you keep modifying your script, when it was fine, apart from the console.log line. You had everything there, but removed most of the working code for some reason..

     

    Please add the names.push(name); line to inside the loop.

    -------------------------------------------------------------------------

    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.

     

  • YeuHarng Profile Picture
    48 on at

    YeuHarng_0-1693367140357.png

    YeuHarng_1-1693367227807.png

     

    YeuHarng_2-1693367239258.png

    hi the problem still there , can u help me 

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Try joining the array into a single string.

    Change your return statement to return names.join(', ');

    This will join them into a single string delimited by a comma and a whitespace.

    -------------------------------------------------------------------------
    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.

  • YeuHarng Profile Picture
    48 on at

    thankieww so much i solve 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 432

#2
11manish Profile Picture

11manish 313 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 154

Last 30 days Overall leaderboard