What is the "current" object in a catalog item?

Community Alums
Not applicable

I need to get the name of a catalog item into a script include from a reference qualifier. I was going to use the "current" object, but I can't figure out what type of record it is, and i need to know that in order to dot-walk.

Help?

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Andrew,



"Current object" refers to the current record being referenced. You can use current to pass to the script include, like ScriptInclude(current.cat_item.name), then in the script include, you have myScriptInclude(catItemName)


View solution in original post

9 REPLIES 9

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Andrew,



"Current object" refers to the current record being referenced. You can use current to pass to the script include, like ScriptInclude(current.cat_item.name), then in the script include, you have myScriptInclude(catItemName)


Community Alums
Not applicable

Pradeep,



Thanks for your help. I knew the current object was generally the current record you were work with, but in this case I wasn't getting results for "current.name" for example.



im passing in current.cat_item.name, and logging it to see what i get, and it's coming back undefined. I guess I could do a query since current.cat_item is giving me the item's sys_id but I'd rather not do another query if at all possible.


BALAJI40
Mega Sage

use current.cat_item in reference qualifier// you will get the sys_id of the catalog item.


further if you need name of catalog item, then gliderecord on sc_cat_item table.


You can dot-walking to get the name of the catalog item as current.cat_item.name