Add Benefit Plan of projects in Project Status Reports - PPT export

AlfrinAJ
Tera Expert

Need help in adding a extra slide in a PPT to accomodate Benefit Plans and Resource Assignments in the power point template of the Status report. 

 

I am not able to create related table for Benefit Plan Baseline in the "Project status report" record in "sn_ppt_export_ppt_report_type" table.

1 ACCEPTED SOLUTION

1. Enabled the add-ins in Microsoft PowerPoint with 365 license
2. Open power point templates table (sn_ppt_export_ppt_template), then open the Project Status and then go to Report type reference record
3. Click new in Related Tables and add the Benefit plan (benefit_plan).
4. Then check Advanced checkbox to write custom script

(function getData(parentRecordSysID) {

    var encodedQuery = '';

    // Get the project_status record
    var gr = new GlideRecord('project_status');
    gr.get(parentRecordSysID);

    var projectId = gr.project;

    // Query benefit_plan where top_task matches project
    var benefitGr = new GlideRecord('benefit_plan');
    benefitGr.addQuery('top_task', projectId);
    benefitGr.addQuery('benefit_type', 'non_monetary');
    benefitGr.query();

    while (benefitGr.next()) {
        encodedQuery += benefitGr.sys_id + ',';
    }

    // Remove trailing comma and format as sys_idIN query
    if (encodedQuery) {
        encodedQuery = encodedQuery.slice(0, -1);
        encodedQuery = "sys_idIN" + encodedQuery;
    }

    return encodedQuery;

})(parentRecordSysID);

5. Go to the PowerPoint template, create new slide and open the ServiceNow add-in
6. Select report type as Project Status Report, Data as Table and select the Benefit plan table added in Step 3
7. Then select the column from the benefit plan table, Copy the command which will be displayed below, then Paste wherever you want.
8. Save the template, then upload it in the Project Status Report Template - default in sn_ppt_export_ppt_template table.

 

Now you will be able to see Benefit plan in Status reports whenever you export...

 

View solution in original post

4 REPLIES 4

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @AlfrinAJ 

 

Might be helpful

 

https://www.servicenow.com/docs/bundle/utah-it-business-management/page/product/project-management/t...

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

danielbiesi
Tera Contributor

Hi, 
have you found a solution for this query? 

1. Enabled the add-ins in Microsoft PowerPoint with 365 license
2. Open power point templates table (sn_ppt_export_ppt_template), then open the Project Status and then go to Report type reference record
3. Click new in Related Tables and add the Benefit plan (benefit_plan).
4. Then check Advanced checkbox to write custom script

(function getData(parentRecordSysID) {

    var encodedQuery = '';

    // Get the project_status record
    var gr = new GlideRecord('project_status');
    gr.get(parentRecordSysID);

    var projectId = gr.project;

    // Query benefit_plan where top_task matches project
    var benefitGr = new GlideRecord('benefit_plan');
    benefitGr.addQuery('top_task', projectId);
    benefitGr.addQuery('benefit_type', 'non_monetary');
    benefitGr.query();

    while (benefitGr.next()) {
        encodedQuery += benefitGr.sys_id + ',';
    }

    // Remove trailing comma and format as sys_idIN query
    if (encodedQuery) {
        encodedQuery = encodedQuery.slice(0, -1);
        encodedQuery = "sys_idIN" + encodedQuery;
    }

    return encodedQuery;

})(parentRecordSysID);

5. Go to the PowerPoint template, create new slide and open the ServiceNow add-in
6. Select report type as Project Status Report, Data as Table and select the Benefit plan table added in Step 3
7. Then select the column from the benefit plan table, Copy the command which will be displayed below, then Paste wherever you want.
8. Save the template, then upload it in the Project Status Report Template - default in sn_ppt_export_ppt_template table.

 

Now you will be able to see Benefit plan in Status reports whenever you export...

 

Microsoft Add-In for ServiceNow is not required honestly, if you are sure about the commands...

Like if you want to add Benefit plan Name and Category you need the command to enter in the PowerPoint Slide. 

Benefit Plan Name : ${benefit_plan.name}

Benefit Plan Category : ${benefit_plan.category}