The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Gunjan Kiratkar
Kilo Patron
Kilo Patron

 

Introduction :

List actions in ServiceNow are indeed similar to UI actions, but they specifically cater to actions performed within the context of lists or tables in the platform's interface. These actions streamline user interactions by providing a set of functionalities directly accessible from the list view, enabling quick and efficient management of records without the need to navigate away from the list. 

 

GunjanKiratkar_0-1701588677499.png

Fig. List Actions

Much like UI actions, list actions facilitate various tasks such as creating new records, updating existing ones, triggering workflows, assigning tasks, sending notifications, or executing bulk operations. They offer a user-friendly interface, ensuring that users can perform these actions seamlessly within the context of the list they are currently working on. Moreover, the flexibility of list actions allows for customization to align with specific organizational needs, ensuring that users have pertinent and frequently used functionalities readily available. 

Overall, list actions in ServiceNow enhance the workspace experience by empowering users to efficiently manipulate data within lists or tables, reducing the need for manual interventions, and optimizing workflow processes for increased productivity and effectiveness.

 

Problem Statement : 

Create the List action in Workspace that will export only selected items from the list into the PDF file. e.g. In the below image we can see two incidents are present but I don’t want all of them to export when I can click on the export button. If I select the first incident as shown in the image below then I want to export only that incident in PDF format.

 

GunjanKiratkar_1-1701588776566.png

Fig. Selected Incident

Implementation

 

1. Navigate to Workspace Experience -> Actions and Components -> List actions

GunjanKiratkar_2-1701588897938.png

Fig. Navigate to List Action

2. Create New List action as below : 

i. Select Implemented as client script

ii. Select Proper table on which you want to create the List action. Keep it as Global if you want to make it available everywhere.

iii. Checked record selection required field so that List action will be enable only when you select at least one record from list view.

GunjanKiratkar_3-1701588981046.png

Fig. List action Implementation

3. Code : 

 

 

function onClick() { 
try{
	var checkedRecords= g_list.getChecked();
	var query="sys_idIN"+checkedRecords.toString();
	var table= g_list.tableName;
	var view= g_list.getView();

	var url=table+"_list.do?PDF&sysparm_query="+query+"&sysparm_view="+view+"&sysparm_view=print&landscape=true";
	top.location.href=url;

}catch(ex){
	var message=ex.message;
	alert("Errors:"+message);
}

}

 

 

 

Video Implementation & Testing :

 

Value added in your knowledge ??? Then please mark it as helpful, bookmark it for future use and also share it with your ServiceNow squad.

 

Regards,
Gunjan Kiratkar
Community MVP 2023
Community Rising Star 2022
Youtube : ServiceNow Guy
Comments
devimadala0
Tera Contributor

When I click on list I am seeing the below attached screen, what might be the issue?Screenshot 2025-08-12 173819.png

Version history
Last update:
‎12-03-2023 12:57 AM
Updated by:
Contributors