Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

SPM Export to PowerPoint Template for Demands

AshleyC
Giga Contributor

Hello!  Has anyone exported demand data to a PowerPoint template or can this only be done once in the project stage/project status templates?  TY!

10 REPLIES 10

rhysbrennan
Tera Expert

Not fully tuned but we have the same requirement, and I found my way to an MVP:

PPT Template:

rhysbrennan_0-1698065841413.png

 

rhysbrennan_1-1698065861943.png

 

rhysbrennan_2-1698065878364.png

 

I haven't read the docs so not sure of the options here but I followed the existing templates examples of how to configure multiple rows:

rhysbrennan_3-1698066019659.png

https://servicenow.com/distinctionFlag=related/childTable=dmn_requirement/relatedTo=base/orderByColu...

Setup the report type definition:

rhysbrennan_4-1698066230112.png

 

Setup the Template record and add the attachment:

rhysbrennan_5-1698066299719.png

 

Run the script (need to put this in a UI action etc to make it useful):

var inputDemandID = '7a915d3d9306311054327ee32bba1036'
var PPTGen = new sn_ppt_export.PPTRequestHandler(inputDemandID)

//runPPTGenerator inputs: [string] Table Of Input Record, [string] SysID Of Input Record, [string] Table Of Attachment Record, [string] SysID Of Attachment Record, [string] Attachment File Name
gs.log(PPTGen.runPPTGenerator("dmn_demand",inputDemandID,"dmn_demand",inputDemandID,"MyPPTFileName.pptx"));


Download the attachment:

rhysbrennan_6-1698066452535.png

 




Hi @rhysbrennan I have the same requirement and implemented your solution but somehow gave me the attached errors. I have created a new template and used the existing template as well but no luck. Could you have a look and let me know, please

Hi there - did you ever figure out a solution for this?

Tanuj1
Tera Contributor

Try this, i had to modified a code a bit and worked for me. Please have a look an dtry

var inputDemandID = current.sys_id;

var template = "d9048f5f933231107bc570aefaba10f4";

var PPTGen = new sn_ppt_export.PPTRequestHandler(template);

 

//runPPTGenerator inputs: [string] Table Of Input Record, [string] SysID Of Input Record, [string] Table Of Attachment Record, [string] SysID Of Attachment Record, [string] Attachment File Name

var generatePPT = PPTGen.runPPTGenerator("dmn_demand", inputDemandID, "dmn_demand", inputDemandID, "MyPPTFileName.pptx");

gs.log("GenerateReport" + generatePPT);

Thank you so much for responding! I ended up doing the same and got it working. Added an info message so the user knows it was successful and will be attached to the record, as well as a redirect to stay on the current page.

Thanks again!