Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Run JavaScript Function on web page

Wanting flow to change value of drop down box on web page. Drop down value will be 'Strength' and Field 3 is referencing which drop down box.


Run action but value is not changing need assistance with syntax. Any help is appreciated!





Resolver I
Resolver I

Hi @rhawkins10701 


Could you also please try with the other options like


document.getElementById('Field3').value = 'Strength';
document.getElementById('Field3').selectedIndex = 2;    //Starts from 0, if Strength is at the 3rd position


Also right click on that element and Inspect the code for the dropdown.

Also, some dropdown values are only triggered if the text is written via SendKeys

Help fellow beings find relevant posts.
Upvote to a supporting response.
Mark as solution to an answer.

Thanks I attempted both syntax and still not triggering the dropdown value.  I am not familiar with SendKeys that you were referring to. How would I write text via SendKeys? 


Thanks for your assistance!

Resolver I
Resolver I

Hi @rhawkins10701 


Sendkeys should be the last resort when nothing else works.


You are using Power Automate Desktop, so curious to know why are you looking to inject javascript to change the dropdown value?

You can spy that element and perform any of the UI Automation options that PAD gives.

Set drop-down list value on web page:



This is how the dropdown on the webpage looks like




This is the html of the above webpage





Changing the car value using "Set drop-down list value on web page":




After running the process the dropdown value is changed




Help fellow beings find relevant posts.
Upvote to a supporting response.
Mark as solution to an answer.

Thanks for the assistance with the new action! I am still having issues and I am thinking it is because the web page is crystal reporting. Would this have an effect on the action? I added new UI element and selected the drop down value.




Also, prior to selecting the drop down value I have to click "click to select custom fields" in order to display the drop down values. I've attempted to use action Click Link on Web Page to display drop down values but wasn't working.









Resolver I
Resolver I

Hi @rhawkins10701 


Yes it is true that some webpages are not "spyable" due to the nature they are built.


- Are you able to see the html of the select dropdown just like the way I showed you



- play with the selectors and see which one behaves better than the other.

Keep ticking one or more combination of options





- I will anyways share with you the Sendkeys option too but do keep it as your last alternative


  • Click on that element
  • Use appropriate Wait time
  • After Sending the Down arrow it selected the second element in below screenshot
    • Here you can also send the Down arrow multiple times depending on where your 'Strength' value is in the list
    • Alternatively, you can also type the initial alphabet or the starting few characters like S (as in Strength). Take care about another word starting with the same character S).




- For reference Saab is the 2nd option in the list.


Help fellow beings find relevant posts.
Upvote to a supporting response.
Mark as solution to an answer.


Helpful resources

MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,299)