how to add Info Message to List Action Assignment in Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
This is my List Action Assignment, the functionality is working find but im trying add g_from.addInfoMessage('hi') but nothing is happening.
How can I add info message so it will be visible to the user in List view.
function onClick() {
var checkedRecords = g_list.getChecked();
//gs.addInfoMessage('hi');
//g_form.addInfoMessage('tttt');
var ga = new GlideAjax('WmTaskBatchPdfExporter');
ga.addParam('sysparm_name', 'isPdf'); // Setting input
ga.addParam('sysparm_sys', checkedRecords);
ga.getXML(ajaxCallback);
}
function ajaxCallback(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
if (answer) {
top.location.href = answer;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
g_form.addInfoMessage() works only on form views, so it won’t display anything in a List Action.
To show a message in List view:
If the List Action is server-side, use:
gs.addInfoMessage('Hi');This will display the message at the top of the list.
If it’s a client-side List Action, g_form is not available—use an alert() or call a server-side script to return a message.
This is expected behavior in ServiceNow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I don't think it's going to work in workspace list action
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Alon Grod ,
g_form.addInfoMessage('hi'); this will work only on the forms
List Action - which runs in a list context
gs.addInfoMessage() - this use server side .
workaround : you can create the UI action.(LIST) . using that UI action you can show the message and easily pass the client side data to server side. and display info message
also you can try this but i tried this it was not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @Alon Grod ,
If my response helps you then mark it as helpful and accept as solution.
Regards,
Aditya,
Technical consultant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@adityahubli @Tejas Adhalrao @Ankur Bawiskar @Aswin S @Mohammed8
Hi im trying to using gs.addInfoMessage but it does not work. Maybe I Need to use glide modal? if so how?
Im calling a script include that return an answer back to the client
