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

@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

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');

View solution in original post

5 REPLIES 5

Sandeep Rajput
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

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');

Thanks @Ravi Gaurav as usual thanks a ton 🙂