- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 04:52 PM
Hi there,
Trying to find a way to validate the file format for an attachment on a service catalog item before the user submits the item. I was able to validate that one attachment only is submitted, but I can't validate the file format that the user attaches (content-type = 'text/csv'). I've seen some solutions for widget customization to get the cart ID, as well as other catalog client script methods in the ServiceNow community. I'm on Washington version and every solution/workaround shared on the community seems to be unsupported or not working as suggested. Anyone know of a proven solution or is there a known timetable to being able to solve reference of a cart ID per submission or validation of attached files on a service catalog item in the portal? Much appreciated whatever you can offer! Thank you!
-WilliamLKP
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 08:12 AM - edited 06-11-2024 08:13 AM
Hi @WilliamLKP ,
You can write on submit catalog client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 07:15 AM
@WilliamLKP Here is my implementation for validating the attachment type.
1. Create a variable of type "attachment"
2. Under Type Specifications tab, add the below to variable attributes.
Results:
- If the file type is not .csv format
- If the file type is .csv format
Please mark this as helpful and accept it as a solution if this resolves your query.
Thanks,
Sujatha V.M.
Sujatha V.M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 08:12 AM - edited 06-11-2024 08:13 AM
Hi @WilliamLKP ,
You can write on submit catalog client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 02:49 PM
Thanks for the solutions! I chose the onsubmit catalog client script, since that required the least amount of addition customer updates, but seems like they both will do the trick. 😀