Variables shown in approval form

emanuelesignori
Kilo Contributor

Hi,

I don't understand what kind of variables are shown on the Approval Form, because i've noticed that not all variables are shown.

I would like to know how to show only variables that are visible in Catalog Item view, is this possibile? How can i do this?

 

Thanks in advance.

1 ACCEPTED SOLUTION

Hi Emanuele,



You will need to investigate the Approval Record widget. You can see this line there:



if (itemsGR)


    item.variables = $sp.getRecordVariablesArray(itemsGR);



Which then is used in the body to display those:


<div ng-repeat="variable in item.variables" class="m-b-xs" ng-if="variable_toggle">


    <label>{{::variable.label}}</label>


    <div>{{::variable.display_value}}</div>


</div>



Unfortunately I can't see any docs about getRecordVariablesArray and how it gathers those variables:


documentation/widget_server_script_apis.md at b7caf92ec819c9ea2e1815200f75bf57ee9de47b · service-po...




Regards



Greg


View solution in original post

6 REPLIES 6

Alex87
Tera Contributor

hi there,

I was wondering where you configure the template that is being used for each type of approval. So knowledge, Request etc. 

shivanipatel
ServiceNow Employee
ServiceNow Employee

Emanuele,



We are glad you took advantage of the ServiceNow Community to learn more and to get your questions answered. The Customer Experience Team is working hard to ensure that the Community experience is most optimal for our customers.



If you feel that your question was answered, we would greatly appreciate if you could mark the appropriate thread as "Correct Answer". This allows other customers to learn from your thread and improves the ServiceNow Community experience.



If you are viewing this from the Community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View.



Thanks,


Shivani Patel


Unknown-1.png