Monday, November 7, 2016

How to refresh Drop down list of values based on other 'Select Box' Value in Service Catalog

Use case: Based on 'First' Select Box selected value, Refresh the Second 'Select Box' values  for a Service Catalog item in Service Now

Solution

- Create a new 'Catalog Client Script'

-  Applies to 'Service Catalog Item'

- Type - 'onChange'

- Catalog Item - Select the appropriate catalog item, for which you want to implement this functionality

- Varaiable Name - 'Select appropriate variable' In this example, First 'Select Box' variable name

-  Write the script as below

g_form.clearOptions('state');

var cat = g_form.getValue('country');

if(cat == "usa"){
g_form.addOption('state','WI','Wisconsin');
g_form.addOption('state','TX','Texas');
}
if(cat == "india"){
g_form.addOption('state','AP','Andhrapradesh');
g_form.addOption('state','TG','Telangana');
}



Thursday, November 3, 2016

How to Upload a file using Macro in Service Now?

This blog explains about how to implement 'Upload File' feature using Macro in Service Catalog in Service Now

Use case - Provide the ability to upload a file in Service Catalog Item

Solution

- UI Macros
- Create New, Add the Jelly script code as shown below


<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<b>Use the paperclip</b>  
<a onclick="saveCatAttachment(gel('sysparm_item_guid').value, 'sc_cart_item')">  
<img title="Attachments..." height="16" src="images/icons/attachment.gifx" border="0" width="16"/></a>  
<b>to attach items to this request.</b>  
</j:jelly>

-  Go to Service Catalog Item, where you want to implement this feature
- Create a new variable of a type 'Macro with Label'
- Goto 'Type Specifications' tab and Choose the Macro newly created in above step
- This how it shows



Wednesday, November 2, 2016

How to see all the changes performed by specific user in Service Now ?

This blog explains about how to see, what are all the activities performed in any Service Now Instance by specific user ?

Use Case : I wanted to see what are all the activities performed by 'Ravi' in 'Development Service Now Instance' ?

Solution

- System Logs -> Transactions
- You can filter by user name