Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Need help to make the code work dynamically

Piyushh_garg1
Tera Contributor

Hello Experts,

Need help with the below code to make it pick the table dynamically depending if it is a request item table or change request table or any other task table .

its showing the correct Ticket number but in the current behaviour it is only searching in the change_request table 

 

<div ng-if="data.isValid">
<div class="panel panel-{{::options.color}} b">
  <div class="panel-heading">
    <h2 class="panel-title">${Approval request for {{::task.table}} {{::task.number.display_value}}}</h2>
  </div>

  <div class="panel-body">
    
    <div ng-if="task.u_change_owner"><label>${Change Owner}</label> {{::task.u_change_owner.display_value}}</div>
   <div ng-if="task.risk"><label>${Risk}</label> {{::task.risk.display_value}}</div>
     <div ng-if="task.category"><label>${Category}</label> {{::task.category.display_value}}</div>
 <div ng-if="task.cmdb_ci"><label>${Configuration item}</label> {{::task.cmdb_ci.display_value}}</div>
    
    <div ng-if="task.opened_by"><label>${Opened by}</label> {{::task.opened_by.display_value}}</div>
    <div ng-if="task.requested_by"><label>${Requestor}</label> {{::task.requested_by.display_value}}</div>
    <div ng-if="::data.approver"><label>${Approver}</label> {{::data.approver}}</div>
    <div ng-if="task.start_date"><label>${Start}</label> {{::task.start_date.display_value}}</div>
    <div ng-if="task.end_date"><label>${End}</label> {{::task.end_date.display_value}}</div>
 <div ng-if="task.change_plan"><label>${Implementation plan}</label> {{::task.change_plan.display_value}}</div>
    <div ng-if="task.u_testing_evidence"><label>${Pre Implementation plan}</label> {{::task.u_testing_evidence.display_value}}</div>
   
  <p>
    </p>
    <div ng-if="task.number"> <p>Please click here to open the Change record <a href="/change_request.do?sys_id={{::task.sys_id.display_value}}" target="_blank">{{::task.number.display_value}}</a></p></div>
    <div ng-if="task.quantity">${Quantity} {{::task.quantity.display_value}}</div>
    <div ng-if="task.price.value > 0"><label>${Price}</label> {{::task.price.display_value}}

 

 

6 REPLIES 6

Its not returning any table name 

Below is the URL it went to 
https://suncorpdev.service-now.com/.do?sys_id=4259c5c91bcd0250fdf6dbd5dc4bcb6a

Piyushh_garg1
Tera Contributor

Still Looking for Help on this .
Let me know if anyone can provide a solution