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 / Click link with javasc...
Power Automate
Answered

Click link with javascript does not open link.

(0) ShareShare
ReportReport
Posted on by 19

Hi all. I am having an issue trying to get PAD to click the link which would open a download option but it's not working. Attached are screenshots of the HTML behind the scenes and the javascript function I am attempting to call. I must say, if I put the code in the console window, it opens up the save as window as you would expect. Not sure if I'm missing anything here. The link is contained inside an iFrame, which I grab the link and populate in a new tab. 

 

***FIRST SECTION OF CODE TO GET TO EXCEL**** (This works fine as you will see in 3rd image)

Capture.PNG

 

*** EXCEL LINK*****

excelEsport.PNG

 

Below is the function I am trying to execute (Line 27). As you can see, I am able to get the dropdown to show the Excel option (line 25). 

 

document.querySelector('[title="Excel"]').click();

 

 

capture2.PNG

I have the same question (0)
  • tkuehara Profile Picture
    667 on at

    Hi @kenthub 

     

    Try changing the selector to:

    document.querySelector('[title=Excel]').click();

     

  • Verified answer
    kenthub Profile Picture
    19 on at

    I ended up using move mouse to image and it works. The JS was being pesky and found that resolved my issues for some other tricky/pesky JS button/links. 

     

    Thanks for your help though!

  • AshleyPettit Profile Picture
    40 on at

    Hey @kenthub,

     

    As you mention move to image works. There is another solution if you like.

     

    1. Use "Click UI element in Window" [Not webpage]

    2. Select the correct 'Pane' -> Use this selector (:desktop > pane[Name="Bulk apply - PageUp People - Google Chrome"])

      - You need to replace the Name above with the name of the webpage

    3. Use this to select the element within the pane ->  > document[Class*="Chrome"] > table > custom > dataitem[Name*="503400"] > list[Id="lJobCombo_1"] > listitem[Name*="503732"]

     - Replace Name*="503400" with your own selectors 

     

    In short this is using desktop clicks no web clicks. This does an actual click not a webpage click. 

     

    AshleyPettit_0-1638840230542.png

     

    AshleyPettit_1-1638840249567.png

    AshleyPettit_2-1638840271621.png

     

     

  • AshleyPettit Profile Picture
    40 on at

    Here is the name of the "Pane"

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 382

#2
Valantis Profile Picture

Valantis 370

#3
David_MA Profile Picture

David_MA 300 Super User 2026 Season 1

Last 30 days Overall leaderboard