- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 10:03 PM - edited 06-05-2025 02:26 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 03:29 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 01:50 AM
Hi,
On the record producer, there is a script field, and you can insert there a simple piece of code:
Example:
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! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 01:56 AM
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! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 03:21 AM
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! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 03:29 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader