How to delete a document template ?

Sarah_P
Tera Expert

Hello,

 

In Utah I have created several HTML document template that I now want to delete.

 I can't seem to find how. Templates are in Editing state.

1 ACCEPTED SOLUTION

Sarah_P
Tera Expert
In the end I created the following Fix Script in the scope of the Document Template to put the Templates I wanted to delete in Draft state.

 

 

 

var docTemplateIds = [
    '38e1ea601b59fd108cf1dce0b24bcbc8',
	'1099aeac1b59fd108cf1dce0b24bcbbb',
	'0ba9aeac1b59fd108cf1dce0b24bcbbf'
];

var gr = new GlideRecord('sn_doc_html_template');

gr.addQuery('sys_id', 'IN', docTemplateIds);
gr.query();
while(gr.next()) {
    gs.info("Deleting Document Template : " + gr.name);
	gr.setValue('state', 'draft');
	gr.update();
}

 

 

Then I deleted them from the list.

View solution in original post

6 REPLIES 6

Vaishnavi Lathk
Mega Sage
Mega Sage

Hello,

Refer below thread :- https://docs.servicenow.com/en-US/bundle/utah-platform-user-interface/page/use/using-forms/task/t_De...

Delete checklist or a template
  1. In the navigation filter, enter checklist_template. list .
  2. Select the check box by the checklist template you want to delete.
  3. In the actions choice list, select Delete, found at the bottom of the page.
  4. In the confirmation dialog box, click Delete.

Regards,

vaishnavi Lathkar

Hello,

thank you for the answer but my question is not related to checklists.

Community Alums
Not applicable

Moonie
Tera Expert

Hi Sarah,

 

I'm not sure if the HTML document template that you mentioned is this one, but I think you can try it. Let's navigate to All > Document Templates > All Document Templates. Please make sure that you have admin role to do this. The list will show all document templates, then you can delete what you want.

 

Hope this can help you!

 

Regards,

Moonie

-----

Please mark my response as correct/helpful as applicable!