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

How to trigger one specific catalog item?

Jessica28
Tera Guru

Hello,

I have an onChange type client script that reload the form after updated. I need help with the script to trigger only one catalog item.  Thanks

 

Jessica28_0-1713916022002.png

 

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @Jessica28 ,

You want this script(which you attached) to only trigger for one specific catalog?
If yes, then you can modify it like this-

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}

var catalogItemSysId = 'your_catalog_item_sys_id_here'; // Replace 'your_catalog_item_sys_id_here' with the sys_id of your catalog item
var currentCatalogItemSysId = g_form.getValue('cat_item'); 

if (currentCatalogItemSysId === catalogItemSysId) {
// Add your condition here, if needed

location.reload(); // Reload the form
}
}

 

Please mark as Accepted Solution if this solves your query .

 

View solution in original post

6 REPLIES 6

Isaac Vicentini
Mega Sage
Mega Sage

Hi Jessica,

 

To create a client script for a specific Catalog Item, you must create it from the "Catalog Client Script" module.

IsaacVicentini_0-1713926500228.png

 


Best regards,

Isaac Vicentini
MVP 2025


If my answer was helpful, mark it as Helpful or Accept as Solution.

Hi @Isaac Vicentini ,

I could not find the "Quantity" field on the catalog item dropdown.  Please advise.  Thanks

 

In the Type field, you should select onChange.

In the Catalog Item field, you should select name of your Catalog Item.

Once you do this, in the "Variable name" field, the "Quantity" variable will be available.

 

IsaacVicentini_2-1713962694928.png

 

 

 


Best regards,

Isaac Vicentini
MVP 2025


If my answer was helpful, mark it as Helpful or Accept as Solution.

@Isaac Vicentini 

I understand that it will work if the "Quantity" is a variable type. However, the "Quantity" is actually field type on the form.

Jessica28_0-1713971846746.png