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.

Get cat item display value

maryc
Tera Contributor

Hi,

How do I get a cat item display value from sc_req_item table? I have only REQITM info on the page.

Also I need to get the values of custom fields in sc_req_item table


Any sample code available?


Thanks

1 ACCEPTED SOLUTION

bernyalvarado
Mega Sage

Hi Mary, if you're looking for the values of your catalog item variables then you can do something like



Server:


current.variables.variable_name;



Client:


g_form.getValue('variable_name');



Thanks,


Berny


View solution in original post

3 REPLIES 3

erik_brostrom
Mega Guru

Depends... Are you trying to get via a BR? Client Script?



Business Rule would be something like:


current.cat_item.getDisplayValue();


once way for Client Script would be


var cat = g_form.getReference('cat_item');


alert(cat.name);



A little more about the requirement of getting it would help propose a better solution.


Thanks for your reply. Just to give a little bit more info -


I am using jelly script to get this req item no by querying the task_survey table.


From this req item I need to get the values of item type and couple of custom columns from sc_req_item table.



Any help on that?


bernyalvarado
Mega Sage

Hi Mary, if you're looking for the values of your catalog item variables then you can do something like



Server:


current.variables.variable_name;



Client:


g_form.getValue('variable_name');



Thanks,


Berny