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 / Javascript code runs i...
Power Automate
Unanswered

Javascript code runs in console but not in PAD

(0) ShareShare
ReportReport
Posted on by 2

I'd like to set a bank account number in a form input which has a format mask of XXXXXXXX-XXXXXXXX-XXXXXXXX and all the characters are numbers.

The jQuery code works in the console, but in PAD it does not. The jQuery code is the following:

$('#provision-form').find('input[ng-model="provision.bank_account"]').val('11111111-11111111-11111111');

I already has some jQuery in PAD which had no problem, but this one gives me a headache.

 

Could you give me a hint what the problem could be?

  • VJR Profile Picture
    7,635 on at

    Hi @Peti 

    Just wanting to know are you not able to access the UI element of the form by capturing that element and then writing the bank number to it?

    Is there any specific reason you chose javascript code over UI based automation of PAD?

  • Peti Profile Picture
    2 on at

    Yes, it was not working if I gave it an Xpath for the UI element, it was not setting the value. That's why I tried to do it with javascript. But it still doesn't want to work. 😕 

  • VJR Profile Picture
    7,635 on at

    HI @Peti 

     

    You might not want to use xpath for accessing the element, but need to make changes to the selectors of that UI element (from the RHS in PAD).

    Are you able to share some screenshots with complete details?

  • PAG Profile Picture
    154 on at

    I've had the same problem, works in console but not in PAD. I also got this error "$ is not a function". Did some investigation and found out that it was a security issue (injection) with modern browsers, it would have worked with an old Firefox version.

     

    Maybe you could try to dynamically load jQuery library in ExecuteScript and then execute your code? See example:
    https://power.automate.gallery/5rpEmF79QoC6 

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
Mohsin Ali Profile Picture

Mohsin Ali 423

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 177

Last 30 days Overall leaderboard