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 / How to change the href...
Power Pages
Answered

How to change the href attribute in hyperlink tag using JQuery on Subgrid

(0) ShareShare
ReportReport
Posted on by 105

I have a subgrid (from the contact table) featuring four columns. The initial column is a lookup originating from the account table, while the fourth includes dropdown item controls, such as "view details." Clicking on "view details" opens a new page with the URL that includes the ID and the record's relationship. My goal is to extract each account GUID from the lookup column and append it to each dropdown's hyperlink. This modification will enable me to display a subgrid of the account table on the subsequent page by appending the account to the URL.

 

/*
 This code appends the Organization GUID to the dropdown menu's <a>.

*/
$(document).ready(function () {
 $('.entity-grid.subgrid').on('loaded', function () {
 $(this)
 .children('.view-grid')
 .find('tbody tr')
 .each(function (i, e) {
 var orgId = $(this).find('td[data-attribute="rsp_assignedtoid"]:first').data('value').Id;
 var originalHref = $(this).find('td:last a').attr('href');
 var newHref = originalHref + '&oid=' + orgId;
 $(this).find('td:last a').attr('href', newHref);
 });
 });
});

 

I've attempted the provided code and explored alternative implementations, but it doesn't appear to be functioning. I would appreciate any assistance or guidance.

Categories:
  • Verified answer
    aofosu Profile Picture
    105 on at

    I changed the subgrid control to a list control and it works. 

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 45

#2
sannavajjala87 Profile Picture

sannavajjala87 30 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 22 Super User 2026 Season 2

Last 30 days Overall leaderboard