Not able to pass row id to the page item

I am having a interactive grid in oracle apex. One of the column is a pop up lov type. when the user changes the value in this column, it has to open a page and pass the row id of that particular cell. I tried the below JavaScript.

 var ig = apex.region("your_grid_region_static_id").widget().interactiveGrid("getViews", "grid").model;
var selectedRecords = apex.region("your_grid_region_static_id").widget().interactiveGrid("getSelectedRecords");

// If a row is selected
if (selectedRecords.length > 0) {
var record = selectedRecords[0];
var rowId = ig.getValue(record, "ROW_ID");  // Replace ROW_ID with the column name in your IG that holds the row id

    // Redirect to page 82 and pass the ROW_ID as a parameter (P82_ID)
    window.location.href = apex.util.makeApplicationUrl({pageId: 82}) + '&P82_ID=' + rowId;

} else {
alert("Please select a row.");
}

I am not able to open the page with above code.

I can open the page with this code

window.location.href = apex.util.makeApplicationUrl({pageId: 82}) +      '&P82_ID='

but unable to pass the row id.
Any help would be great full.