Hide the delivery date and estimated delivery if no value

Jet R
Tera Contributor

How can I hide the Estimated Delivery and Delivery Date fields if there are no value. The delivery time in catalog item is 0 days. I am looking at the widget SC_Order_Status but not sure where to edit here.  I know there is a check box in the catalog item to hide the delivery date, but would it be possible to configure it the widget level?

 

Anyone who implemented same before? Please help. Thanks

Screenshot 2023-08-02 141954.jpg

1 ACCEPTED SOLUTION

@Jet R 

after cloning you can update this line to hide it if empty

line number 36

<div class="text-muted" ng-if="::options.display_delivery_date == 'true' && data.request.show_estimated_delivery!='' ">
${Estimated Delivery} : {{::data.request.show_estimated_delivery ? data.request.esimated_delivery : '--'}}
</div>

AnkurBawiskar_0-1690974902176.png

 

Similarly do in the next few lines where they are rendering it as table

AnkurBawiskar_1-1690974943100.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

9 REPLIES 9

@Jet R 

then you need to clone the OOB widget; update the script to hide it and then add that new widget on that page

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Jet R 

after cloning you can update this line to hide it if empty

line number 36

<div class="text-muted" ng-if="::options.display_delivery_date == 'true' && data.request.show_estimated_delivery!='' ">
${Estimated Delivery} : {{::data.request.show_estimated_delivery ? data.request.esimated_delivery : '--'}}
</div>

AnkurBawiskar_0-1690974902176.png

 

Similarly do in the next few lines where they are rendering it as table

AnkurBawiskar_1-1690974943100.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

It's working! Thank youn @Ankur Bawiskar !!!!

@Jet R 

Glad to help.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader