increment the filename for screenshot/image

Joyal Robert
Tera Contributor

We need to increment the filename for the screenshot/image attached in HTML type field
Currently all the screenshot/image are showing in same filename pastedimage.png
Is there any setup we can do to increment like psatedimage.png, pastedimage(1).png, pastedimage(2).png

Please help me on this on priority

 

Regards,

Joyal Robert

1 ACCEPTED SOLUTION

Di Zhang
Tera Guru

Just an idea, add a before business rule to sys_attachment table to check if there is same attachment name added to same task ,change the name to add increment suffix. 

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Joyal Robert 

I don't think it's possible directly.

You can try to play with before insert business rule on sys_attachment table and update the file name there

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,

 

The users are requesting for it. How can we achieve this through custom way through business rule. Give me sample script or hints to put together that how can we work on it

 

Regards,

Joyal Robert

Di Zhang
Tera Guru

Just an idea, add a before business rule to sys_attachment table to check if there is same attachment name added to same task ,change the name to add increment suffix. 

Hi @Di Zhang

Thanks for the idea. It works for me.