The CreatorCon Call for Content is officially open! Get started here.

Request Item show Approvers in list view

carlosrlara
Mega Expert

Currently, the only field on request items that shows approval information is stage and only tells you the status. I have an ask to show who the approver is on the list view.

I believe the only way to accomplish this is to copy the approver on the sys_approval table to the sc_req_item table. I created a field on the requested item field as Approval For(u_approval_for)

Business Rule condition. There are no actions, as i have used advanced

find_real_file.png

Code

(function executeRule(current, previous /*null when async*/) {

var requestitem = new GlideRecord('sc_req_item');

requestitem.get(current.document_id);

if(requestitem.isValidRecord()) {

  sc_req_item.u_approval_for =   current.approver + ',' + sc_req_item.u_approval_for;

requestitem.update();

}

})(current, previous);

1 ACCEPTED SOLUTION

Harel, i fixed my problem


i switched my approval for field to be a reference field to the user table.


i modified the script to be


requestitem.u_approval_for =   current.approver ;



and now the approval for field displays the approver


View solution in original post

11 REPLIES 11

venkatvraman17
Kilo Guru

You might want to consider creating a Glide List field similar to watchilist and use your before business rule to add/remove the users to the array based on the approvals


This will show up in a list view? I just want to show who the approval is waiting for