web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to get Run Javascr...
Power Automate
Unanswered

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,204 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard