Form redirection in the portal

pk2184046
Tera Expert

We have a record producer based on the variable selection we have to redirect to some different record producers in the service portal.  Like we have to use on change client script which is fine but after the redirection the form values needs to be copied to the redirect record producer

 

Now can we copy the variable vales from the original record producer to the redirect ones ,using client scripts ?

we have around 10 fields to be copy and make readonly

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@pk2184046 

in the client script where you are redirecting include the variable values in URL and then in the other record producer you can use onLoad catalog client script to get the variable value from URL

check these links on how it can be done

How we can set the variables on catalog item form from UI action.  (recommended)

Redirect from a UI Action to a Catalog Item and set default values 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

GlideFather
Tera Patron

Hi,
On the record producer, there is a script field, and you can insert there a simple piece of code:

Example:

producer.portal_redirect = "esc?id=sc_cat_item&sys_id=8beaf861c38122109e6298ec05013176";

this will redirect you after the submission to the:
https://your-instance.service-now.com/esc?id=sc_cat_item&sys_id=8beaf861c38122109e6298ec05013176
———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Important part for you is the
producer.portal_redirect = '';

Depending on where you would like to redirect the user, you will copy the URL to that line.

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


GlideFather
Tera Patron

Regarding the variables, where exactly you will be redirecting?

The variables can be displayed using the variable formatter (in the form designer), if you mean to have that in the backend view and/or workspace, if you do the formatter, it will respect the form layout from the portal - form with 3 fields will display 3 fields in backend, form with 15 fields will display 15 etc... two columns on portal will be 2 columns in backend, it just copies the variable values to the form.

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Ankur Bawiskar
Tera Patron
Tera Patron

@pk2184046 

in the client script where you are redirecting include the variable values in URL and then in the other record producer you can use onLoad catalog client script to get the variable value from URL

check these links on how it can be done

How we can set the variables on catalog item form from UI action.  (recommended)

Redirect from a UI Action to a Catalog Item and set default values 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader