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 get Run Javascr...
Power Automate
Suggested Answer

How to get Run Javascript On Web Page to access PAD variabes.

(0) ShareShare
ReportReport
Posted on by 28
I have a script that works when I hard code the target string ("Appraised Values")> How do I get it to accept the variable %targetText%
 
 
 
However when I try to get it to accept a variable it fails to execute
I have the same question (0)
  • Suggested answer
    eetuRobo Profile Picture
    4,478 Super User 2026 Season 1 on at
    Put quotation marks ("") around the variable.


     
    function containsTargetText() {
    	var pageText = document.body.innerText || "";
    	
    	if (pageText.includes("%TargetText%")) {
    		return "Yes";
    	} else {
    		return "No";
    	}
    }
     
  • Suggested answer
    CU20012229-0 Profile Picture
    12 on at
    Thank you. That worked

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 408

#2
David_MA Profile Picture

David_MA 253 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 201 Most Valuable Professional

Last 30 days Overall leaderboard