Creating buttons on each row of a list

hsantana8
Giga Contributor

I am trying to add a button to each row of a list displaying a table. This button should create a pop up or open a new tab with information stored in the row. For example, the URL should be Column1info.com.

I was able to create a button on the bottom of the list or in the banner, but not for each row.

I tried creating a column in the table the type script, but could not make it work.

Any information will be very appreciated.

2 REPLIES 2

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Hugo,



You can use UI Actions to create buttons at the top and bottom of lists and choices in the right click menu on an individual list item, but I don't think you'll be able to add buttons to each record in an the list view.


To add onto this, I just created a list banner button that iterates through the selected items to open pop ups for each. This is the code:



function viewAttachment(){


var attachments = g_list.getChecked();


var arr = attachments.split(',');


var t = 20;


var l = 20;


for(i = 0;i < arr.length;i++){


var url = '/sys_attachment.do?sysparm_referring_url=tear_off&view=true&sys_id=' + arr[i];


window.open(url,"","width=750,height=750,top=" + t +",left=" + l);


t += 20;


l += 20;


}


}