The CreatorCon Call for Content is officially open! Get started here.

harish123__
ServiceNow Employee
ServiceNow Employee

Creating and Customising Status Reports and templates with Dynamic Tokens in Project Workspace

   Effective project management relies heavily on timely and accurate status reporting, and Project Workspace offers a powerful solution by allowing users to create and customise status reports using dynamic tokens, which automate data insertion and streamline the reporting process.

This article guides you through creating and customising status reports and templated in Project Workspace, focusing on default templates, creating new templates with dynamic tokens, and understanding the script includes behind these reports.


Default Status Reports

Project Workspace provides default status report templates that can be accessed through the "Doc Templates" section from L1 menu. These templates include dynamic content that uses tables such as project status, risks, issues, decisions, and actions. Users can create new status reports using these templates, which automatically creates data for dynamic tokens based on records.

default_status_report-ezgif.com-video-to-gif-converter.gif

 

 

Creating a Status Report using default template

To create a new status report in ServiceNow, navigate to the Project Workspace, open the specific project, and go to the Status Report section. From there, select "Create Status Report" and choose the "Create New from Template" option. You will then be prompted to select a template for the report. Once the template is selected, the status report is generated within minutes, with all values populated automatically using dynamic tokens. These tokens are replaced with real-time project data, such as project name, status, milestones, due dates, and other relevant details.

ScreenRecording2025-03-13at2.17.04PM-ezgif.com-video-to-gif-converter.gif



Creating a New Template and using Dynamic tokens

To create a new template in ServiceNow, navigate to Docs Templates from the L1 menu. Once there, users can select the "New" option and ensure that the category is set to "Project Status Report". Users can then add dynamic content such as project details and tables by typing / and selecting "Insert Dynamic Content." From there, they can choose the appropriate dynamic tokens to insert, which will automatically populate with real-time project information when the template is used. Additionally, users can create tables and provide the necessary details within the template, ensuring that the report has a structured format and all relevant data is included. This feature simplifies the reporting process by automating data insertion.

 

ScreenRecording2025-08-26at7.28.18PM-ezgif.com-video-to-gif-converter.gif

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Creating new status report using custom template

ScreenRecording2025-03-13at2.45.14PM-ezgif.com-video-to-gif-converter.gif

 

Scripting and Data Generation

The dynamic tokens used during status report template creation are generated by the script include "StatusReportDynamicTemplateSchemaSNC" for Project Workspace versions 6.3.0 or later. For earlier versions, the script include "ProjectWorkspaceStatusReportUtil" is used instead. Script include "StatusReportDynamicTemplateDataProvider," play a crucial role in generating status report data during report creation by fetching details for dynamic tokens and populating the reports accordingly.

 

Customisation and Script Modification

Users can customise the reports by modifying the script includes according to their business logic. This allows for flexibility in what tables and data are included in the dynamic content.

By following these steps, users can effectively create new templates and customise status reports in Project Workspace.

Thank you 😊

Comments
Andriana
Tera Contributor

Hello

 

Thank you for this very informative post! 😁 The new Status report generation engine in Project workspace does look promising, but it feels like there are some features missing compared to the old Project workbench. Yokohama does fix some core issues, but improvements can still be made.

 

Specifically, fields from the Teamspace tables and custom fields may not be available when using /Insert dynamic content. A workaround does exist (you can directly edit the Content(JSON) field on the sn_doc_page_template), but I don't think this is the optimal or easiest way. 

 

Additionally, filters can not be easily applied to related lists (e.g. Issues, Risks etc.). To add a filter to a related list, you need to modify the Content(JSON) field again, and edit the 'queryFilter' attribute. With that said, the queryFilter attribute only accepts " field = X" queries, not encoded or any other type of queries (e.g. field IN X). This is pretty limiting.

Lastly, modifying the OOB Script includes does seem a bit drastic, and we try to avoid that as much as possible.

 

The new Project workspace does improve the overall user experience and the ability to edit a generated Status report on the fly is very useful. I do hope our concerns are addressed in future releases. 

 

Thanks

pattipdx
Tera Contributor

I do not see the docs icon under the home icon. I get a page not found error when I navigate to <instance>/now/workspace/project/doc-templates. Any ideas how I enable this?

 

pattipdx
Tera Contributor

I do not see the docs icon under the home icon. I get a page not found error when I navigate to <instance>/now/workspace/project/doc-templates. Any ideas how I enable this?

harish123__
ServiceNow Employee
ServiceNow Employee

Hi @pattipdx ,
Can you please check if you have sn-docs plugin installed and is compatible with Project workspace.

Vladi1
Kilo Guru

Hi @pattipdx.

Can you please check if the plugin "Project Workspace" id = sn_pw is updated to the latest version?

You should be able to see two icons in left vertical bar in Project Workspace - Project and Doc Template. 

Screenshot 2025-04-29 101421.png

Attila Beregvar
Kilo Sage

Nice article, thank you!

Does anyone know what script and function gets executed when a user presses the "Create Status Report" action on the project workspace? I have an issue, that the report gets created in the background table (project_status) with all details, but fields "Template" and "Content" are empty.
My assumption is that somehow the system cannot translate the content of the report into JSON and because of this the report is not available in the Project Worksapce. I would like to debug this, but don't know which script gets executed first.

Much appretiated!

djvasant
Tera Contributor

@harish123__  We use the feature each day and has improved a bit recently. Few things are still challenging and hope SN team solves it.

 

1) HTML rendering

2) Retired feature - Apply Template was a feature that allowed user to change a template for existing records. Hope they could bring that back with better enhancements

3) Export / Print as WYSIWYG w/ proper HTML rendering

4) Image that could have hyperlink (For Ex. Help/Wiki logo that takes to Wiki)

sieusaopolo15
Tera Guru

Is there is any chance I can customize this with scripting ? I want to create another table and it's data is getting from the child project and status report of that child project. Is that even possible ?

VinothiniA
Tera Contributor

Hi ,

Is it possible to create template by adding field condition in template?
We are generating two types of report, one is for internal and another one for Customer . In internal status report by default that risk record should be included and in customer report it should not be if the checkbox is not checked .
For e.g. . In Risk record , we are having custom field ' Share with customer' , if that check box is checked then that risk record should be included in customer status report else it should not be .
Is it possible to achieve this in new project workspace status report?

darshanabanchar
Tera Contributor

Hi team,

Similar to resources, cost, scope, overall fields here i need to add one custom field. Can anyone help me in what are the script include or function i need to modify? so that when i click on create status report, that custom field with choice and comments on that field should also ask to select in new project workspace.

DavidB-ADT
Tera Guru

@harish123__  Thanks for the article. My company is pilot testing the new status reports, and we'd like to report a minor bug.

 

The comments for the individual status reports are rendering with the HTML tags in the generated status report:

DavidBADT_0-1751052816783.png


Whilst the data entry mentions that HTML fields will be stripped of formatting, it seems like the product team forgot to do that for the Comments to Schedule/Cost/Resource/Scope fields.

DavidBADT_1-1751052943240.png

Is there a way for us to fix this ourselves with the aforementioned script modification until it's patched? Can you provide guidance on what scripts we need to review?

Attila Beregvar
Kilo Sage

@DavidB-ADT we had this same issue and solved it with a workaround (not the cleanest, but gets the job done until this is fixed on SN side): we created matching custom string fields for all these HTML fields, and auto populate those with a business rule which cleans up the HTML and any other unwanted tags. Then display these fields on the status report template instead of the ootb ones.

DavidB-ADT
Tera Guru

@Attila Beregvar  - that's a pretty creative workaround, may just do that!

 

I spent a little time digging through the Script Includes trying to find the bug myself, but no luck. I found the code that looks like it handles the HTML conversion, but the outstanding question is why it wouldn't trigger for those status comment fields:

DavidBADT_0-1751314684963.png

I'll keep digging if I have time, but in the interim think I'll use your solution!

 

EDIT: I just had a thought, and I've confirmed what the bug is. It doesn't strip HTML tags when you add dynamic fields to a table cell. If they're just free-standing then it strips them out fine. Will see if I can find the bug in the table code!

DavidBADT_0-1751316054442.png

 

 

VinothiniA
Tera Contributor

Hi, I have followed below steps and created custom table to use in Docs template

 

1) Created custom table similar to table to "Risk baselines" table by extending baseline core.
2) Created similar record to Risk in "baseline configuration"(baseline_config)table. Add field mappings between baseline table and customer table fields. Also set primary reference field.
And also add filter condition to show only the particular data from custom table .

For e.g. if Dependency Type is not empty then show the data under Dependency section in Status report template. But it is showing all data.Do we need to add filter in any other place? like script includes

VinothiniA_0-1751967722849.png

 

Thanks,

 

 

jjorczak
Tera Contributor

Does anyone know how to insert a section in the template to show Agile Stories completed last period? Some research suggests using dynamic content to insert a script, but I can't even find a way to get a script option to appear.

Andriana
Tera Contributor

Hello @jjorczak 

 

I don't think there is any way to insert a script via dynamic content, so unfortunately you need to modify some scripts and do some digging around to allow more tables to be visible. 

 

What we did to add information from more tables (e.g. Cost plan table) is this: 

First, I recommend copying the OOB Status report, not modifying it. Keep the OOB as it is in case you need it as some point. If you want, you can also set up that new Status report as the default one in the system properties.

 

There is an OOB script include that acts as an extension point called StatusReportDynamicTemplateDataProvider. (the original script is called StatusReportDynamicTemplateDataProviderSNC if you want to review the functions). In the function called _getQueryObj, you can see that only certain tables are allowed (risk_baseline, issue_baseline etc.) In the OOB configuration data is sourced from the respective baseline tables, for example risks are not displayed directly from the [risk] table, but from [risk_baseline]. Copy this entire function as it is to the extension point and modify it. Do not modify the StatusReportDynamicTemplateDataProviderSNC script include.

 

The queryObj variable is the query that will filter out data in the target table. Sadly only queries that are "field = x" are allowed. To add another table to the script, you can add the following line in the if structure (this example is for the cost plan table) : 

// ....
// OOB SCRIPT
else if(tableName === 'issue_baseline' || tableName === 'project_action_baseline' || tableName === 'dmn_decision_baseline' || tableName === 'project_change_request_baseline')
		queryObj['show_on_status_report'] = true;
// OOB SCRIPT
// ADD CUSTOM SCRIPT BELOW
else if (tableName === 'cost_plan')
            queryObj = {
                top_task: projectId
            };

 

If you want, you can mimic the OOB logic and use the respective baseline table (e.g. cost_plan_baseline), but that depends on the use case and what you want to achieve. There is information above on how to create additional baseline tables. 

 

For your table, simply replace 'cost_plan' with your table name. In the "top_task: projectID" line, replace 'top_task' with the field that connects your agile stories with the Project record. The 'Completed on last period' filter may be tricky, since only 'field = x' queries are allowed, so you will need to get creative. I'm not sure what you mean by last period (quarter perhaps?), but you might need to add a custom field to your table. That, or you can try modifying the following line to account for more filter types, although you need to be really careful and retain the OOB logic for all other cases except your table. 

const [key, value] = queryFilter.split('=');

 

Once the script is done, you need to mess with your record in 'sn_doc_page_template'. The editor in the workspace will not allow you to add other tables, so you need to directly edit the JSON field. (find a JSON editor to make this easier). If you want to add a table, It's easier to create a table in the workspace editor and then replace the table name and the field names in the JSON editor. For example, for the cost_plan table, I added the following table:

{
							"type": "table_row",
							"content": [
								{
									"type": "table_cell",
									"attrs": {
										"colspan": 1,
										"rowspan": 1,
										"colwidth": null,
										"background": null
									},
									"content": [
										{
											"type": "paragraph",
											"attrs": {
												"textAlign": null,
												"indent": null,
												"associatedRecordField": {}
											},
											"content": [
												{
													"type": "template_token",
													"attrs": {
														"table": "project_status.cost_plan",
														"fieldPath": "name",
														"queryFilter": "ADD YOUR FILTER HERE, NEEDS TO BE FIELD = X",
														"displayValue": "Cost plan/Name"
													}
												}
											]
										}
									]
								},
								{
									"type": "table_cell",
									"attrs": {
										"colspan": 1,
										"rowspan": 1,
										"colwidth": null,
										"background": null
									},
									"content": [
										{
											"type": "paragraph",
											"attrs": {
												"textAlign": null,
												"indent": null,
												"associatedRecordField": {}
											},
											"content": [
												{
													"type": "template_token",
													"attrs": {
														"table": "project_status.cost_plan",
														"fieldPath": "FIELD YOU WANT TO DISPLAY",
														"queryFilter": "ADD YOUR FILTER HERE, NEEDS TO BE FIELD = X",
														"displayValue": "Cost plan/Cost type"
													}
												}
											]
										}
									]
								},

Add another table_cell construct for each column. In "table", replace cost_plan with your table name. In fieldPath, add the field you want to display on the column. In queryFilter add your query. If you did not modify the script accordingly, it needs to be in 'Field = X' format. This is where you will add a filter to only show the stories that were completed last period. The displayValue is what name will be displayed in the column title in the workspace editor (does not impact final status report).

 

This is by no way the optimal solution to this issue. As I mentioned above, the status report functionality is very limited at this point. Since this is a modification on an OOB function, you will need to review it for each upgrade and manually add in any modifications that happen on the OOB _getQueryObj function, or else you might run into issues. Depending on the business requirement, this might not even be worth it in the long run. You will need to consult with your team and decide accordingly. 

VinothiniA
Tera Contributor

Hi,

I am trying to insert dynamic logo in the project workspace status report template based on the project company . I have used (/) insert dynamic content to get company logo from company table but dot walking is not available for Project -> Company field. I have created image field in Project form and copied the image from Company into the string field . But it is not working.

Any idea on how we can achieve this?

 

Thanks,

SravyaPangu
Tera Contributor

Hi @DavidB-ADT , 

I am facing similar issue with the HTML tags showing up on the status report table. Just want to check with you if you were able to find the root cause, before applying the workaround 

Version history
Last update:
‎08-26-2025 07:21 AM
Updated by:
Contributors