Is it possible to show a custom modal from list view in agent workspace?

Sameer15
Kilo Explorer

I know we can edit multiple items from the list in Workspace. Is it possible to show a modal in the list view in the agent workspace? In below if I click on Escalateee, I want to open a modal view and send the input from modal to some script which process it.. Also is it possible to edit the Fields in the Edit button?

find_real_file.png

10 REPLIES 10

Pranesh072
Mega Sage
Mega Sage

You can use g_modal instead.

function onClick(g_form) {
  g_modal.global.showHeader({
    title: 'Test custom modal',
    confirmTitle:'YES',
    params: {
      primaryValue: 'THIS IS A PRIMARY VALUE',
      secondaryItems:{}
    }
  }).then(function(result){
    alert('confirm:'+result);
  }, function(error) {
    alert('cancel:'+error);
  });
}

https://docs.servicenow.com/bundle/paris-servicenow-platform/page/administer/workspace/task/set-up-u...

Hi Pranesh,

 

Thank you for your reply. This works only for UI Action but not for List Action. Could I be missing something?

You have to create action assignment 

 

https://[instance].service-now.com/sys_declarative_action_assignment_list.do?sysparm_view=list_action&sysparm_fixed_query=model%3Dd91731a9534723003eddddeeff7b121c&sysparm_clear_stack=true

 

find_real_file.png

Maik Skoddow
Tera Patron
Tera Patron

Hi @Sameer ,

yes it is possible to open a modal from list view, but how it can be realized depends on what you mentioned with "and send the input from modal to some script which process it".

Typically you would implement an UI Action for that. There are many examples, which you can use as a template for your own UI Action. Go to table UI Actions and filter for "g_modal" at "Workspace Client Script":

find_real_file.png

 

And regarding your second question for displayed fields at list edit action:
You can control that fields by customizing the form layout for view "Workspace" at table of your chioce. 

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.