How can i limit the number of attachments in a catalog item?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-29-2022 03:06 AM
Hello,
We have a catalog item in which we are using the OOTB attachment and we need lo limit that the user can only attach one field but the client don“t allow us to use DOM methods.
So we need to create a Catalog Client Script or something like this to limit the number of attachments.
Anyone have do this?
Thanks to all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-29-2022 04:28 AM
Hello Ankur,
In this article use DOM Manipulation, and we can“t use DOM.
We need to do something like this but withoun using DOM.
Best Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-29-2022 05:10 AM
Hi,
you want this validation for native or portal?
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-29-2022 07:25 AM
Hi,
We need to validate on service portal, before create the item.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-30-2022 02:05 AM
Hi,
inform your client that there are some use-cases where DOM is required to achieve the requirement when OOB doesn't help.
OR
you can use variable of type File attachment
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-29-2022 05:38 AM
Hi Alberto,
I have a solution that I tested in my PDI.
Go to your catalog item and set the "Hide Attachment" flag to false:
Then, add one variable of type "attachment" to your catalog item:
This variable will only allow you to add one attachment!!
I think this is the behavior you are expecting to see, right?
Please, if this answer is relevant for you, please mark it as correct and helpful.
Thanks,
Filipe