How to Auto-Populate Fields in a Target Catalog Item from the Source Catalog Item on Link Click

E555
Tera Guru

Hello,

I would like to auto populate a field in the target catalog item with the request name of the source catalog item when clicking a link within the Description field.

I saw the steps in the post below and created an onLoad client script, but unable to retrieve the value from the previous catalog item:
Pre-populate a record producer form after clicking link on the catalog item

 

The target catalog item has a Reference field that refers sc_cat_item table. I want to auto-fill this field based on the source catalog item from which the link was clicked.

 

Has anyone implemented a similar feature or can guide me on how to achieve this?

Thank you!

E555_0-1735122017681.png

E555_1-1735122024688.png

 

1 ACCEPTED SOLUTION

E555
Tera Guru

Solved error using "location.hash" this in client script!

var url = location.hash;

If possible, I want to automatically fetch sysid of the Test Catalog Item12, rather than directly set the sysid in the URL in the description...But that seems difficult.

If anyone knows of any way to do this, I would appreciate it if you could REPLY to me.
For the time being, the title issue has been resolved.

View solution in original post

6 REPLIES 6

@E555 

Thank you for marking my response as helpful.

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

E555
Tera Guru

Solved error using "location.hash" this in client script!

var url = location.hash;

If possible, I want to automatically fetch sysid of the Test Catalog Item12, rather than directly set the sysid in the URL in the description...But that seems difficult.

If anyone knows of any way to do this, I would appreciate it if you could REPLY to me.
For the time being, the title issue has been resolved.