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 / How to use variables i...
Power Automate
Unanswered

How to use variables in "Run javascript function on web page"

(1) ShareShare
ReportReport
Posted on by 2

 

function ExecuteScript() {
var pattern = %URLPattern%;
return pattern;
}

 

I want to use a PowerAutomate variable in the "Run javascript function on web page" action & realise that PowerAutomate will throw out the error {"message":"element not found","errorcode":2}{"message":"element not found","errorcode":2}.

 

The variable  %URLPattern%; is entered by the user to find URLs with specific patterns.

  • VJR Profile Picture
    7,635 on at

    Can you check with double quotes enclosed "%URLPattern%"

  • Riyaz_riz11 Profile Picture
    4,219 Super User 2026 Season 2 on at

    Hi @learnPower 

     

    Try to pass like this:-

    function ExecuteScript() {
    var pattern = "%URLPattern%";
    return pattern;
    }

     

     

    Regards

    Ahammad Riyaz

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

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 273 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 235

#3
David_MA Profile Picture

David_MA 172 Super User 2026 Season 2

Last 30 days Overall leaderboard