How do we select the standard change template from Flow designer?

switypatel
Giga Contributor

How do we select the standard change template from Flow designer? When I select action as Standard change request it says it will take the template associated to Catalog. Seems like its not working.

12 REPLIES 12

puneetgoels1
Tera Guru

Can you provide the screenshot?

Jacqui
ServiceNow Employee
ServiceNow Employee

I think I understand the issue here. In the 'Create Standard Change Request' Action in Flow Designer, it tells you to use a template and if you don't only offers the description and short description field by default. 

From what I can tell, the only way to add a template is through a custom script. I did it by creating a separate action just for creating standard changes. I didn't have any inputs or outputs and my script looked something like this

(function execute(inputs, outputs) {
    var chg = new GlideRecord("change_request");

    chg.initialize();

    chg.applyTemplate('Template Name Here');

    chg.type = 'standard';

    chg.insert();
})(inputs, outputs);

 

With this script, it created a new standard change and filled in the values from the template. You can also edit individual fields by setting them in that script like I did with the 'type'.

Hi @Jacqui I am working on something similar, but i cannot get it to work. Was your setup something like below?

find_real_file.png

You can use Script Step to apply scripted template in flow.

Use below code to apply scripted template.

 

var rec1 = new GlideRecord("change_request");
rec1.initialize();
rec1.applyTemplate("my_incident_template");

 

Regards,

Sachin