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 / JS Code is output inst...
Power Automate
Unanswered

JS Code is output instead of value PAD

(0) ShareShare
ReportReport
Posted on by 51

Power Automate Desktop - Desktop flows 

 

I am using PAD for extracting data from web page - for few instances I am getting the JS code as output instead of exact text values.

If it happens for all the values then it is issue itself but it happens randomly for some web pages. 

 

Sample code output instead of text value

                            $(document).ready(function () {
                                $("#EnteredQuantity").keydown(function (event) {
                                    if (event.keyCode == 13) {
                                        $("#add-to-cart-button-18205").click();
                                        return false;
                                    }
                                });
                                $(".add-to-cart-button").click(function (e) {
                                    var ProductId = $(this).attr("data-productId");
                                    var EnteredQuantity = $("#entered-quantity-" + ProductId).val();
                                    var AddToCartUrl = "/addproducttocart/catalog/" + ProductId + "/1/" + EnteredQuantity;
                                    console.log(AddToCartUrl);
                                    AjaxCart.addproducttocart_catalog(AddToCartUrl);
                                    return false;

                                });
                            });
                                      

 

But the value for other web pages where the data is extracted is "Product ABC (58 units)".

 

Any help on this issue will be greatly appreciated

I have the same question (0)
  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    Hi @Marutha_K 

    That happens when the page you are automating hold this JS code in the elements you are extractign from.

    In other words, that is not PAD issue, PAD is giving you what is in the page.

    Perhaps scripts are still being loaded and html did not render yet - are you waiting for page to fully load before you start extracting data?

  • Marutha_K Profile Picture
    51 on at

    Hi @momlo ,

     

    Thanks for the reply. I haven't added any Wait control. Can you please recommend some best way to handle the complete page load?

  • Marutha_K Profile Picture
    51 on at

    I have tried adding a Wait control and tried to handle the wait for the page to completely load but it didn't work. 

    Moreover, when I try to use Power Automate Add on - the data is scrapped properly from the site but not while running the flow. 

  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    I still have feeling it is web page issee rather than PAD.

    To prove me wrong or right, you can do the following:

     

    1. Run your flow up until the incorrect data is read from web page - you can add if statements to catch that and pause the flow

    2. Use F12 / Dev tools in browser to inspect the element.

    3. If web page is ok, you should see correct element  but if my feelings are right, you will see all that code included in the element even though browser might not show it on the page.

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard