How to open a catalog item with pre-populated variables from a portal "Create New" button?

CharanV66187530
Tera Contributor

Hello Community,

I have added a "Create New" button on my Service Portal. My goal is that when a user clicks this button, it opens a specific catalog item, and some variables on that item are automatically populated with predefined data.

Could someone please guide me on how to achieve this functionality? Specifically:

  • How do I pass variable values when opening the catalog item from the portal?
  • Is there a recommended way to implement this using URL parameters or client scripts?
  • Any examples or best practices would be much appreciated.

Thank you in advance for your help!

Reference:
HTML :
<button ng-click="c.createNew()">Create New</button>

Server Script:

(function() {
  // Pass the URL to client script
  data.redirectUrl = "/sp?id=sc_cat_item&sys_id=67e2f2da4fff0200086eeed18110c7dd";
   
})();
Client Script:
api.controller = function() {
  var c = this;

  // The URL sent from server
  c.url = c.data.redirectUrl;

  // Function to open URL in new tab
  c.createNew = function() {
    window.open(c.url, '_blank');  // Opens URL in a new browser tab
  };
};




15 REPLIES 15

Laveena-Agarwal
Mega Sage

Hi @CharanV66187530 

 

You can create "onLoad" catalog client script on the catalog item to pass the variables.

Hi @Laveena-Agarwal,

 

Thank you for your reply.

The actual scenario is as follows:
If an RITM is marked as "Rejected" on the portal side, the "Create New" button should be displayed. When we click this button, I want to open a new catalog item form and pre-populate it with data from the previously rejected RITM.

If I create a catalog client script, it always populates the data regardless of whether we access the form through the portal or directly via /sp. I want to avoid this behavior.

Could you please suggest how to implement this functionality?

Thanks,

Charan Sai

Hi @CharanV66187530 

Select the specific UI- 

Screenshot 2026-03-23 at 10.34.37 AM.png

@Laveena-Agarwal, Thank you for your reply. The actual scenario is as follows:
If an RITM is marked as "Rejected" on the portal side, the "Create New" button should be displayed. When we click this button, I want to open a new catalog item form and pre-populate it with data from the previously rejected RITM.

If I create a catalog client script, it always populates the data regardless of whether we access the form through the portal or directly via /sp. I want to avoid this behavior.

Could you please suggest how to implement this functionality?