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 Apps / Environment Variables ...
Power Apps
Suggested Answer

Environment Variables in Web Resources

(1) ShareShare
ReportReport
Posted on by 938
 
I have a page set up in my model driven all to show another app in the same frame as a web resource. The url is just an iframe snippet to the app. is there a way to implement environment variables in the webresource  URL to update the appid as we navigate thru the different environments? 
 
Thank you 
 
 
 
 
I have the same question (0)
  • Vish WR Profile Picture
    3,748 on at
     
    you can’t directly use Environment Variables inside a static HTML web resource URL. 
     
    You can use script to load the url with dynamic value


     
  • Suggested answer
    11manish Profile Picture
    3,333 on at
    Environment Variables cannot be directly used in a Web Resource URL because Web Resources are static and do not resolve Dataverse values at runtime.
     
    The recommended approach is to use a JavaScript Web Resource to retrieve the Environment Variable via the Dataverse Web API and dynamically construct the iframe URL.
     
    Alternatively, consider using a Custom Page, which natively supports environment variables and provides a more modern and maintainable solution.
  • Suggested answer
    Kalathiya Profile Picture
    2,456 Super User 2026 Season 1 on at

    You can’t directly plug environment variables into a web resource URL, but you can work around it via using JavaScript.

    Store your appId in an environment variable, then use JavaScript (Xrm.WebApi) to fetch it and set the iframe URL dynamically. That way it changes automatically across environments.

    Yes, environment variables are accessible via the Web API.

    If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well.
    ---------------------------------------------------------------------------------

    📩 Need more help? Just mention @Kalathiya and I’ll be happy to assist.

    ✔️ If this answer helped you, please tick “Does this answer your question?” so it can be marked as the Verified Answer.

    💛 A Like always motivates me to keep contributing!

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard