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 / Date Popup Window with...
Power Automate
Answered

Date Popup Window with java script filling main webpage

(0) ShareShare
ReportReport
Posted on by 78

Hi to all,

 

question to automatically downloading a csv file through a website.

 

I have a webpage I need to filter by date. The textfield with the date is not possible to update (1), it is locked. You need to select a date by opening a datepicker (2) website, which seems to execute a javascript, which somehow fills the field (1). 

I can click on the numbers, but when numbers are appearing more than 1 time, it is going to click on the first appearance. So to click is no option.

 

Is there a way to execute the javascript on the website with PAD without clicking in the UI?
I tried it already with the action "JavaScript function on web page" with the code appearing in the hover text, but this didn't work.

 

Any hints or ideas?

 

Thank you and best regards

SwiPowE

SwiPowE_ch_0-1689608491661.png

 

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You don't need the "javascript" part in your JavaScript script. Try simply using "SetDate('Donnerstag 07.06.2023'):" in the Run JavaScript function on web page action. 

     

    You would need to inspect the page elements to see if they really use this method. Try inspecting any of the dates in the browser developer tools and see what they do on click.

     

    Alternatively, you could check if your URL changes when you select a date. Maybe the date is there in the query parameters of the URL. If that is the case, you could build your URL by using a base URL and passing the date you need into it. Then use Go to web page to navigate to that URL.

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

  • SwiPowE_ch Profile Picture
    78 on at

    Hi Agnius 

    thanks for your reply and good tips ... I tried already to execute the javascript using this syntax:

    SwiPowE_ch_0-1689663749082.png

    No error message, but nothing happens on the main page. I think the problem could be, that I am executing this script on the main instance of the browser, not on the popup page. I don't know how to access the popup page to execute this script, i can imagine that this could be working.

     

    Inspecting the popup page I find the following code. I guess somehow one could work with code knowing the "eventTarget" or whatever? Do have an idea seeing the code?

    SwiPowE_ch_1-1689664019675.png

     

    On the date controls the code is the following:

    SwiPowE_ch_2-1689664259499.png

     

     

    The URL of the main page is without date parameter, on the popup page there is one which selects the current date. Opening the popup URL with a date parameter in a new instance loses the connection to the main page, so clicking on the days results in no action on the main page.

     

    Do you have any other ideas / suggestions?

    Thank you and best regards

     

    SwiPowE

     

  • Verified answer
    SwiPowE_ch Profile Picture
    78 on at

    Hi Agnius, hi all,

     

    I found out how to access the popup and execute the javascript on this page.

    You can append an existing instance to the browser and establish a new instance which you can access.

    Executing the script on the new instance does the magic. Wow, I love it!

    SwiPowE_ch_0-1689665179951.png

    Thanks for your help!

    Best

     

    SwiPowE

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Well, yes, that will happen if the pop-up is a separate browser window. You need to attach to it to be able to interact with it. I did not realize that originally.

    Glad that you found the solution.

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
11manish Profile Picture

11manish 298 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 289

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard