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

Community site session details

Session Id : HjFyH1p2YzMqvRWIDJP+NS
Power Pages - General Discussions
Unanswered

Power Pages button help

Like (0) ShareShare
ReportReport
Posted on 13 Sep 2023 14:39:42 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:
I have the same question (0)
  • Saud Ali Profile Picture
    812 Super User 2024 Season 1 on 14 Sep 2023 at 09:34:58
    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
    8,060 Super User 2025 Season 2 on 13 Sep 2023 at 22:47:56
    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 13 Sep 2023 at 14:41:51
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#2
Lucas001 Profile Picture

Lucas001 48 Super User 2025 Season 2

#3
KevinGador Profile Picture

KevinGador 44 Super User 2025 Season 2

Loading started
Loading complete