How can i create a Custom preview from the ui Action Button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2025 12:56 AM
Use Case: I have an action button to create an article from the response of an api. before creating the article the article i need to preview it to user for approval is there any way to do this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2025 01:02 AM
you can use UI page to render the content and then have OK and Cancel button
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2025 09:47 AM
Thank you for the reply tried it but the rendering is not working properly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2025 01:09 AM
Hi @fibinpious
If your UI action is of client side, you can use "GlideModal" to show the article content to the user, below is the sample script
var dialog = new GlideModal();
dialog.renderWithContent('<div>Hello World</div>');
Please refer the official document for more information : here
Also I have answered similar type of question earlier as well, please take a look at it so that you'll be getting the idea here
✅ Please accept the answer and mark it as helpful if it works for you! ✨
Regards,
Prince Arora
🌟 ServiceNow Rising Star 2023–24 🌟
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2025 01:32 AM
Before an article is created, it is not possible to preview it.
As an alternative approach, I recommend creating the article in a draft state upon button click, and then displaying a customer UI Page or widget. This custom page / widget should include a confirmation button (e.g., Confirm or cancel) and embed the standard (OOB) UI Page (kb_view) or widget KB Article Page. This allows you to use the existing OOB article interface without heavy customization.
Your custom UI Page or widget should therefore include:
- A confirmation button to finalize the article creation
- A cancel option
- The embedded OOB article page, helping to avoid over-customization
If the user clicks Cancel, you may choose to either delete the draft article or retain it based on the customer's data clean-up strategy to prevent an accumulation of draft records.
If the user clicks Confirm, I suggest redirecting them to the standard article page, allowing them to publish the article there. This helps avoid duplicating OOB publishing logic, which is not recommended.