Restrict duplicate attachment on Service Portal form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2024 05:20 AM
I have a requirement to avoid duplicate attachments on service catalog form on service portal. When users add same attachment twice, it should throw an error on top and restrict the duplicate attachment insertion. I have achieved this with BR on the native UI. But the BR is not working on service portal.
How to achieve this via widget scripts? Please help me with this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2024 07:03 AM
Hello @Balamurugan Pal ,
Might be you need to edit attachment widget for this.
Thank you!!
Dnyaneshwaree Satpute
Tera Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2024 08:02 AM
Hi @Dnyaneshwaree ,
I don't have separate attachment widget. It is just included with another page widget. If I can get sample widget script to avoid duplicate attachment, then it will be helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2024 08:05 AM
not possible to check this on catalog form on portal.
I will suggest to discuss this with your customer for the requirement
how will you identify duplicate file? is it based on file name and extension?
Even if file name and extension are same content might be different within so how will you decide if it's duplicate or not?
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
‎08-20-2024 08:15 AM
Hi @Ankur Bawiskar ,
We just need to identify the attachments with name. For ex. if an image file is attached with 'img01.png', then after if another file with same name 'img01.png', then the portal should throw an error.