- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2024 01:50 AM
I have a widget with the following code:
HTML:
<div>
<h1>
Display PPT
</h1>
<p> {{data.IncidentNumber}} </p>
<div id="ppt-widget">
<iframe src="$viewer.do?sysparm_stack=no&sysparm_sys_id=f2253344830e42102a921630ceaad3d1" width="100%" height="100%"> </iframe>
</div>
</div>
Server Script:
(function() {
var incidentSysId = '35e47f48830e42102a921630ceaad374';
var gr = new GlideRecord('incident');
if (gr.get(incidentSysId)) {
data.IncidentNumber = gr.getDisplayValue("number");
} else {
data.IncidentNumber = 'Incident not found';
}
})();
However this is prompting me to download the presentation. I want to display it directly. How to do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2024 05:28 AM
Finally made it work:
Enabled document viewer and added this to the widget.
<div id="ppt-widget">
<iframe src='https://<<myinstance>>.service-now.com/$viewer.do?sysparm_stack=no&sysparm_sys_id=f2253344830e42102a921630ceaad3d1' width='100%' height='100%' frameborder='0'></iframe>
</div>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2024 02:05 AM
Hi @vidhya_mouli ,
You must use a compatible viewer that allows for the embedding of PowerPoint files if you want to display a PowerPoint presentation (PPT) inside a widget without requiring a download. Depending on the platform or viewer you are using, there may be different ways to achieve this.
For example, if you upload the presentation to OneDrive:
- Upload the PPT file to one of these services and obtain an embeddable link.
- Replace the src attribute in your iframe with the embeddable URL.
<div>
<h1>Display PPT</h1>
<p>{{data.IncidentNumber}}</p>
<div id="ppt-widget">
<iframe src="https://view.officeapps.live.com/op/embed.aspx?src=YOUR_PPT_FILE_URL" width="100%" height="100%"></iframe>
</div>
</div>
If you find my response helpful, please consider marking it as the 'Accepted Solution' and giving it a 'Helpful' rating. Your feedback not only supports the community but also encourages me to continue providing valuable assistance.
Regards,
Amitoj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2024 04:32 AM - edited 05-04-2024 05:19 AM
Thank you. It helped and it works. But I have a follow up question. This file is attached to the incident and I will be displaying it in the portal. Is it possible to directly get the attachment and display it instead of uploading it somewhere else.
I used the following code, but getting an error:
<div id="ppt-widget">
<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=https://myinstance/$viewer.do?sysparm_stack=no&sy...' width='100%' height='100%' frameborder='0'></iframe>
</div>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2024 10:03 AM
If you find my response helpful, please consider marking it as the 'Accepted Solution' and giving it a 'Helpful' rating. Your feedback not only supports the community but also encourages me to continue providing valuable assistance.
Regards,
Amitoj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2024 03:57 AM
Hi @vidhya_mouli ,
Please check this article and please try to create link from here.
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak