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 access catalog category name of catalog item?

zsolt_mester
Kilo Contributor

Hi everyone,

I'm looking to access the category name of the catalog item inside a workflow script.

I know I can access the catalog item number like this:

current.cat_item.u_number

But how do I access the catalog category name, the catalog item is listed under?

I have tried:

current.cat_item.u_category

current.cat_item.category

But it seems it is found somewhere else.

Does anyone have any ideas?

Thank you

1 REPLY 1

Chuck Tomasi
Tera Patron

Is your workflow on the Requested Item (sc_req_item) table or another? (Check the properties to verify.)



If it's on the sc_req_item table, then current.cat_item.category will show you the primary category, but there may be others. For that you would need to access the many-to-many table sc_category and do a query against the current.cat_item value to get all the category values.