Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how to get to current Catalog Item in a Variable set of variable by Reference Qualifier

chunn
Tera Expert

hello I want to know how to get the current catalog item in a variable set of variable reference qualifier?

I create to the variable set and create to variable field in the variable set.

the variable type is reference, I want to get the current catalog item sysid by script include.or

 other  method?

thanks.

 
 

 

 

4 REPLIES 4

Sohail Khilji
Kilo Patron

@chunn ,

 

You can create a  reference qualifier for the field. 

 

 

javascript:current.variables.sys_id

 

 

 

This must help !

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

@Sohail Khilji 

thank you reply for me but  i try it. it is not work.

I set to the variable field in the varialbe set. how to get to the catalog item the sysid.

 

@chunn  

 

May i know wat did you try ?

You must use this in the default value:

javascript:current.variables.sys_id

 

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Namrata Ghorpad
Mega Sage

Hi @chunn ,

Write below code in onLoad Client Script and try.

 

var catItem=g_form.getParameter("sysparm_id"); 

g_form.setValue('variable_name',catItem);

 

Please refer the below links.

https://www.servicenow.com/community/now-platform-forum/how-do-you-get-the-sys-id-of-a-catalog-item-... 

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0723775 

 

Please mark my answer as correct and helpful if it helps you.

Regards,

Namrata