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 Pages / request.params.id alwa...
Power Pages
Answered

request.params.id always return the same value

(1) ShareShare
ReportReport
Posted on by 25
Hello everyone,
 
I put this code in the "Header" web template of my website
 
{% assign paramid = request.params.id %}
 
<script type="text/javascript">
const paramID = "{{ paramid }}";
console.log(paramID)
</script>
 
And I found that once I open the page with that url one time. When I try to reload the page with the same url but another "id" parameter, the value of the "paramID" never changes. It will always be the value of the "id" parameter that I uses when I first open that window. I tried refreshing and I tried entering the url with a different "id" parameter but nothing changed.
 
I tried putting the code in the html file of the page and there was no problem. However the function that this code is a part of exist on every page. So I want the put this code in the "Header" web template.
 
Does anyone know what I did wrong here? What do I have to do to get the {{ request.params.id }} to return the current "id" url parameter?
 
Thank you in advance.
Categories:
I have the same question (0)
  • Verified answer
    Fubar Profile Picture
    8,487 Super User 2026 Season 1 on at
    There are Site Settings that if set will Cache the Output of the Header and Footer - it is probably this that is causing your problem, you will need to make sure it is turned off. See the Site Settings 
    • Header/OutputCache/Enabled
    • Footer/OutputCache/Enabled
     
    (Note: after making changes you will need to either Sync and then re-preview your site or manually clear the Portal Cache (login to the portal as a user with the Administrators Web Role and then click the button at <your portal domain>/_services/about)
  • CU31070723-0 Profile Picture
    25 on at
    This solved my problem. Thank you!

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
11manish Profile Picture

11manish 56

#2
Valantis Profile Picture

Valantis 46

#3
rezarizvii Profile Picture

rezarizvii 25

Last 30 days Overall leaderboard