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 / how to key in value in...
Power Automate
Unanswered

how to key in value in input field on web page using run javascript action

(0) ShareShare
ReportReport
Posted on by 43

hi , 

i want to key in value in input field on web page using run javascript action. plz find attached screenshot Can anyone plz tell how to do this .

kanha123_456_0-1718712373380.png

kanha123_456_3-1718712471352.png

 

 

I have the same question (0)
  • Verified answer
    Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 on at

    @kanha123_456 

     

    First inspect your target element using F12 in your browser and right click your click(In this example its input textbox), then click "Copy JS Path". 

    Deenuji_0-1718713360430.png

     

    Now go to console and paste the copied element details in console window like below and in the end add ".value" as mentioned in the screenshot.

    Deenuji_1-1718713588660.png

    Now its entered text through javascript.Now you can copy and paste the same script in power automate desktop.

     

    Hope you already launch browser and configured all the parameters and flow is successfully launching your website. now add "Run javascript on webpage" and place the javascript inside the tag.

     

    function execute{

    your javascript here

    }

     

     

     

     

     


    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 🚀

  • kanha123_456 Profile Picture
    43 on at

    @Deenuji thanks for help , could u plz also tell if i have many input text fields how to write the script for all the fields in one run javascript action on webpage action

  • NathanAlvares24 Profile Picture
    1,714 Moderator on at

    Hi @kanha123_456 !

     

    Try this script in this format:

     

    function ExecuteScript() {
     const usernameField = document.querySelector("#username");
     const passwordField = document.querySelector("#password");
     
     if (usernameField && passwordField) {
     usernameField.value = "Hello";
     passwordField.value = "World";
     return true;
     } else {
     return false;
     }
    }

     

     

    So it will return "true" if those query selectors were a success else "false".

     

    I tried in this pic which has 2 input fields:

    NathanAlvares24_0-1718715423753.png

     

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard