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 / Power Pages button help
Power Pages
Unanswered

Power Pages button help

(0) ShareShare
ReportReport
Posted on by 3

Hello, I am trying to set a button with a dynamic ID that changes based on which case you chose. So if I chose case 1 (id 1234), I want to set the button inside that case to be casedocuments/id?=1234 but then if I go to case 2 (id 4321) the button then needs to read casedocuments/id?=4321.

 

Please let me know if I need to explain better. 

123123.PNG
Categories:
  • ddanna567 Profile Picture
    3 on at

    The picture attached to main post should explain better

  • Fubar Profile Picture
    17 Super User 2026 Season 1 on at

    Either use JavaScript /JQuery to extract it from the window.location and update the button or use Liquid code to get the Id from the request params

     

    https://learn.microsoft.com/en-us/power-pages/configure/liquid/liquid-objects#request

  • Saud Ali Profile Picture
    812 Super User 2024 Season 1 on at

    Hi @ddanna567 ,

     

    Assuming you've already added a button to each of your (Case Details) Web Page, let say like this:

     

    <button id="casedocuments">Case Documents</button>

     

    Here is one of the ways, you can get/set button id based on your record id:

     

    $(document).ready(function () {
     //Get Current Case Id (Opened)
     var caseId = '{{ request.params['id'] }}';
     // Select the button by its current ID and update the 'id' attribute
     var formattedId = "casedocuments-id"+ caseId;
     $("#casedocuments").attr("id", caseId);
    });

     

    Please note, there are other ways too, you can even create a button dynamically instead of changing button id on page load. 

     

    Feel free to reach out, if you have any question. 

     

    Thanks,

    Saud

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

     

     

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 Pages

#1
M Bilal Khan Profile Picture

M Bilal Khan 110

#2
sannavajjala87 Profile Picture

sannavajjala87 30 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 30

Last 30 days Overall leaderboard