7 views

How to modify the "Request for" widget on the service catalog homepage



Description


This articles details the steps on how to modify the "Request for" widget on the service catalog homepage for requirements such as modifying the records that are returned.

Procedure


1) Navigate to the sc_catalog_requested_for UI macro (note that there also exists a similar UI macro sc_catalog_requested_for_v2; we recommend to modify both) as the "Request for" widget is controlled by this UI macro.

2) In here you may modify the functionality as desired.

For example we'd like to modify the reference so that it only returns users whose name starts with "Joe". In line 14 of the UI Macro we change it from:

query="${gs.getProperty('glide.sc.request_for.query')}"

To:

query="nameSTARTSWITHJoe"

Applicable Versions


All versions

Additional Information


"glide.sc.request_for.query" is a system property which has a default value of "active=true". So OOB the "Request for" widget is defaulted to only returns user records where active is checked. This property can be modified to append more queries as desired.

This documentation lists the available operators that can be used for the query: https://docs.servicenow.com/bundle/helsinki-application-development/page/script/server-scripting/reference/r_AvailableJavaScriptOperators.html

Article Information

Last Updated:2018-04-25 08:42:39
Published:2018-04-25