Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
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. 

Categories:
  • Saud Ali Profile Picture
    812 Super User 2024 Season 1 on at
    Re: Power Pages button help

    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.

     

     

  • Fubar Profile Picture
    7,964 Super User 2025 Season 1 on at
    Re: Power Pages button help

    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

  • ddanna567 Profile Picture
    3 on at
    Re: Power Pages button help

    The picture attached to main post should explain better

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 69 Super User 2025 Season 1

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 49 Most Valuable Professional

#3
Jon Unzueta Profile Picture

Jon Unzueta 43