Portal Page Data pass !!

sanyalshubh
Tera Contributor

How to pass data from one portal page to another portal page?
In the past I have passed the data from widget to another widgets... but what about pages ?? Any leads

2 ACCEPTED SOLUTIONS

Sandeep Rajput
Tera Patron
Tera Patron

@sanyalshubh 

You can pass data in the URL when navigating from one portal page to another.

<a href="/sp?id=target_page&user_id={{user.sys_id}}">Go to Target Page</a>

 

Following can be used to retrive the data.

 

var userId = $location.search().user_id; // Retrieves the value from the URL
console.log("User ID:", userId);

View solution in original post

Ravi Gaurav
Giga Sage
Giga Sage

Hey @sanyalshubh 

Keep a thumb Rule :-

To access data between two pages, we need to send data via URL as shown below.

Set URL as below on source page client controller :
function ($scope, $window) {
var c = this:
c.onClick = function () {
$window.location.href = "/sp?id=new_portal_page&incidentNumber=" + INC00001234;
}
}

On the server side of the target page, we can use below code to access those parameters:
var incNumber = $sp.getParameter('incidentNumber');

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

View solution in original post

5 REPLIES 5

Sandeep Rajput
Tera Patron
Tera Patron

@sanyalshubh 

You can pass data in the URL when navigating from one portal page to another.

<a href="/sp?id=target_page&user_id={{user.sys_id}}">Go to Target Page</a>

 

Following can be used to retrive the data.

 

var userId = $location.search().user_id; // Retrieves the value from the URL
console.log("User ID:", userId);

Thanks @Sandeep Rajput  this worked 🙂

Ravi Gaurav
Giga Sage
Giga Sage

Hey @sanyalshubh 

Keep a thumb Rule :-

To access data between two pages, we need to send data via URL as shown below.

Set URL as below on source page client controller :
function ($scope, $window) {
var c = this:
c.onClick = function () {
$window.location.href = "/sp?id=new_portal_page&incidentNumber=" + INC00001234;
}
}

On the server side of the target page, we can use below code to access those parameters:
var incNumber = $sp.getParameter('incidentNumber');

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

Thanks @Ravi Gaurav as usual thanks a ton 🙂