Add to Visual Task Board – Any record (Form context)

I really like Kanban-style dashboards. In ServiceNow, we have Visual Task Boards.

I really love them, but I don’t like the second word in their name: Task. Why only tasks?

I want to be able to add any record in the system to a freeform board.

For example, I might have a list of Scripts, notifications, or logs that I want to review.

So, how can we bypass the restriction?

Follow me through the implementation of this proof of concept!

The idea

We can use Personal tasks [vtb_task] as an interface between the VTB Card [vtb_card] and the actual record

Instead of:

VTB Card [vtb_card] → Target record [task]

We can have:

VTB Card [vtb_card] → Personal Task [vtb_task] → Target record [any record in the system]

The code

How do we do that?

With a single UI Action and relying on the out of the box functionality.

Create a new Global UI action (easier if you just copy the OOTB one “Add to Visual Task Board”).

Name: Add to VTB (non-task)

Type: Form context menu.


Code language: JavaScript (javascript)


Code language: JavaScript (javascript)


function openAddToBoardDialogForm() {

  //var taskSysID = gel('sys_uniqueValue').value, //We won't use the current record as the target record
  var tableName = g_form.getTableName();

  //Create the VTB task record / Personal task
  var grVTB = new GlideRecord('vtb_task'); //TODO: Replace the Client-side GlideRecord
  var shortDescription = g_form.getValue('short_description') || g_form.getValue('name') || g_form.getValue('number');
  if (!shortDescription) {
  grVTB.short_description = shortDescription;

  var taskSysID = grVTB.insert();

  //Add a comment in the Personal task with a link to the actual record
  var grVTBComment = new GlideRecord('sys_journal_field'); = 'vtb_task';
  grVTBComment.element = 'comments';
  grVTBComment.element_id = taskSysID;
  grVTBComment.value = '[code]<a href="' + tableName + '.do?sys_id=' + gel('sys_uniqueValue').value + '" target="_blank">' + shortDescription + '</a>[/code]';

  //The code below is exactly the same that you can find in the OOTB "Add to Visual Task Board" UI Action

  var o = new GlideOverlay({
    title: getMessage("Select a Visual Task board"),
    iframe: "$" + taskSysID + "&sysparm_table_name=" + tableName + "&sysparm_nostack=true",
    allowOverflowX: true,
    height: 1000,
    width: 2000,
    messages: "",
    onAfterLoad: function() {


function displayMessageStashFormContext() {
  if (!this.getData("messages"))


  var m = this.getData("messages");
  if (
    for (var i = 0; i <; i++) {
      var msg =[i];
      if (msg)
  if (m.messages.error)
    for (var i = 0; i < m.messages.error.length; i++) {
      var msg = m.messages.error[i];
      if (msg)
Code language: JavaScript (javascript)


Now, we can add anything to a board.

Why don’t we use our newly created UI Action to test itself?