- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 12-04-2023 04:00 AM
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.
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.
Fig. Selected Incident
Implementation :
1. Navigate to Workspace Experience -> Actions and Components -> List actions
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.
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
- 5,736 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
When I click on list I am seeing the below attached screen, what might be the issue?