How to display requestor on approval widget?

Moedeb
Tera Guru

I am using the 'out of the box' widget - Approval Record on my Approval page through the portal, there is a part of the HTML template that asks to display the requested by field value:

<div ng-if="task.requested_by"><label>${Requestor}</label> {{::task.requested_by.display_value}}</div>

However this will not display at all for me.

Obviously showing the approver who has actually made the request is somewhat important.

I tried to update the field name as ours appears to be called "requested_for", however that still didn't work.

I checked that the field was spelt correctly, using the correct case for all letters and that the field actually existed on the requested item (and was filled out) and it still won't show.

I also attempted to dot walk to get the value from either the request or requested item and that still didn't display the value.

Here are all the options I've tried without any success: 

  • sc_task.request_item.request.requested_for
  • sc_req_item.request.requested_for
  • request.requested_for
  • task.requested_for
  • requested_for

When I checked what  columns are available in the task table, there is absolutely nothing for requested anything (no requested_by or requested_for or anything else that could be the value I want to display)

Would love some help please

1 ACCEPTED SOLUTION

Xavier Cordero
Kilo Sage

Hello Moedeb,

The widget is looking for a field called "requested_by", not the field called "requested_for". This widget is used for every approval out there, the line which has the "requested_by" for example, will display on approvals for change records (change_request table), and I'm guessing probably some other tables (whichever tables which have a requested_by field) but not on "sc_req_item", or parent request table, since these tables do not have the field. If you want to get this field to work for the request table, or any other table:

  • The path of least resistance: is to create a field called "requested_by" and make a BR which updates the field to be the same as "requested_for" on before "insert" and "update" if "requested_for" changes (for any of the tables which have the requested for field).

Or:

  • The alternative would be to clone the widget, edit the code in the line to "requested_for" and replace the "Approval Record" widget within the approval service portal page (which I do not recommend, for multiple reasons, including potential upgrade headaches down the line). This path also has a higher upfront complexity in development.

View solution in original post

1 REPLY 1

Xavier Cordero
Kilo Sage

Hello Moedeb,

The widget is looking for a field called "requested_by", not the field called "requested_for". This widget is used for every approval out there, the line which has the "requested_by" for example, will display on approvals for change records (change_request table), and I'm guessing probably some other tables (whichever tables which have a requested_by field) but not on "sc_req_item", or parent request table, since these tables do not have the field. If you want to get this field to work for the request table, or any other table:

  • The path of least resistance: is to create a field called "requested_by" and make a BR which updates the field to be the same as "requested_for" on before "insert" and "update" if "requested_for" changes (for any of the tables which have the requested for field).

Or:

  • The alternative would be to clone the widget, edit the code in the line to "requested_for" and replace the "Approval Record" widget within the approval service portal page (which I do not recommend, for multiple reasons, including potential upgrade headaches down the line). This path also has a higher upfront complexity in development.