Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Checklist cannot be displayed in HR Task

honamiUeo
Tera Contributor

I am using this article to create an HR Task Template for Checklist and creating an HR Service where the Fulfillment Type is Service Activity.

https://www.servicenow.com/community/hrsd-forum/checklist-for-hr-task/m-p/1286127#M1447

https://docs.servicenow.com/ja-JP/bundle/vancouver-employee-service-management/page/product/human-re...

 

However, the task generated from it does not show the checklist.

honamiUeo_0-1698304732100.png

By the way, this HR Task is generated through Flow Designer.


Can someone please help me with this?

2 ACCEPTED SOLUTIONS

@honamiUeo Unfortunately, this function is only allowed in Global scope either you need to create your flow in Global Scope or create a Script include in Global scope put the logic in there and call that script include in your custom action in flow.

View solution in original post

16 REPLIES 16

@honamiUeo applyTemplate() function can be used in the flow script for applying the template https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0727178

@Sandeep Rajput 

Thanks for letting me know!
Very useful information.
However, I could not figure out how to implement it from the documentation.
If possible, could you please instruct me how to use applyTemplate() with screenshots, etc.?

@honamiUeo You can build a custom action with script step and use the following code to generate the HRTask.

var rec1 = new GlideRecord("sn_hr_core_task");
rec1.initialize();
rec1.applyTemplate("my_HR_Task_template"); //replzce with your template name
rec1.insert();

 

Use this custom action inside your flow. Hope this helps.

@Sandeep Rajput 

Thank you very much!
Just ran the code and it returned the following error

 

Error: Function applyTemplate is not allowed in scope sn_hr_core

honamiUeo_0-1698651919889.png

Sorry for asking so many questions.

@honamiUeo Unfortunately, this function is only allowed in Global scope either you need to create your flow in Global Scope or create a Script include in Global scope put the logic in there and call that script include in your custom action in flow.