Restrict duplicate attachment on Service Portal form

Balamurugan Pal
Tera Expert

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

6 REPLIES 6

Dnyaneshwaree
Mega Sage

Hello @Balamurugan Pal ,

Might be you need to edit attachment widget for this.


Please accept my solution if it works for you and thumps up to mark it as helpful.
Thank you!!

Dnyaneshwaree Satpute
Tera Guru

Balamurugan Pal
Tera Expert

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.

Ankur Bawiskar
Tera Patron
Tera Patron

@Balamurugan Pal 

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.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

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.