The CreatorCon Call for Content is officially open! Get started here.

Service Catalog Builder

sunnyt1
Tera Expert

Does anyone have  any idea how Client Script Page in Catalog Builder fetching the sys_id of catalog item? If you see this page filters the records based on the current catalog item which is being edited in Catalog builder.

 

5 REPLIES 5

Rafael Batistot
Kilo Patron

Hi @sunnyt1 

 

May you try via reference qualifier:

 

javascript:'cat_item='+current.cat_item;

 

https://www.servicenow.com/community/itsm-forum/how-to-get-the-sys-id-of-a-catalog-item-using-the-re...

Hi @Rafael Batistot ,

 

Thanks for your response, but I am talking about "Client Script List" page macroponent.

@sunnyt1 

 

Thanks for specification 

 

In Catalog Builder, the Client Script List page macroponent doesn’t fetch the sys_id by itself, it gets it from the page context.

 

When you open a catalog item in Catalog Builder, the framework passes the current record’s sys_id into the page as a URL parameter (e.g. ?sys_id=<item_sys_id>) and makes it available in the page state. The Client Script List macroponent is configured to read that context variable (sys_id) and apply it as a filter on the catalog client script table (sc_cat_item_client_script).

 

So the flow is:

  • Catalog Builder opens the item → injects the item sys_id into the page.
  • The Client Script List macroponent reads the sys_id from page properties (state.sys_id).
  • It uses that value in the filter condition (something like cat_item=<sys_id>).
  • The list then shows only the client scripts tied to that catalog item.

sunnyt1_0-1756109777462.png

In this scenario, they are getting data from "field" property and then setting state. So I want to know how they are populating this "field" property in page.