How to add a checkbox on timesheet portal

sath
Tera Expert

Hi,

I need to add a checkbox on timesheet portal as shown below:

Screenshot 2024-09-09 at 9.03.13 AM.png

Widget name: Time Card Grid

I have added below code to the HTML template of the widget:

<div  class="checkbox">
          <label>
          <input  type="checkbox" ng-model="c.capex_chkbx">${OPERATIONAL}</label>
   </div>

 

And since the above code is wrapped inside ng-repeat, it yields results like below and if I check one checkbox, all of them are getting set to true

Screenshot 2024-09-09 at 4.31.36 PM.png

If I place the HTML code outside of ng-repeat, it is working like below

Screenshot 2024-09-09 at 4.39.17 PM.png

Could you please assist on the code changes?

2 REPLIES 2

Mayur2109
Kilo Sage

Hi @sath ,

Try to check this community post https://www.servicenow.com/community/developer-forum/how-to-pass-check-box-value-in-widget/m-p/17874... 

 

Please check and Mark Helpful and Correct if it really helps you.

Regards,
Mayur Shardul

ServiceNow Rising Star 2024

Hi @Mayur2109 , Thank you for the response, but the above link doesn't details the help I'm looking for. I'm looking to modify time card grid widget (the code is different to the one you shared) to add checkbox on the line I have added with red on the image.