How to pass data from one portal page to another portal page?

SandeepKSingh
Kilo Sage

Hi Team,

 

This question has been asked in one of my interview. But the point is we don't have to use any OOTB method. like "emit" as it is for widget transfer

2 ACCEPTED SOLUTIONS

Ramesh Poola
Tera Guru

Hi Sandeep,

We can pass the data in URL, Please check the below post once :
https://www.servicenow.com/community/hrsd-forum/how-can-i-send-and-receive-data-from-one-page-to-ano...

 

Regards,

Ramesh

View solution in original post

Ravi Gaurav
Giga Sage
Giga Sage

Hi @SandeepKSingh 

you can use the below :-

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

2 REPLIES 2

Ramesh Poola
Tera Guru

Hi Sandeep,

We can pass the data in URL, Please check the below post once :
https://www.servicenow.com/community/hrsd-forum/how-can-i-send-and-receive-data-from-one-page-to-ano...

 

Regards,

Ramesh

Ravi Gaurav
Giga Sage
Giga Sage

Hi @SandeepKSingh 

you can use the below :-

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/