- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 06:49 AM
Hello ServiceNow Community,
I'm seeking some assistance with a specific requirement on a Record Producer.
Here's the scenario:
I have a checkbox variable on my Record Producer called "Mentioned information is correct". My goal is to make attachments Mandatory on the Record Producer *only when this checkbox is checked (true)*.
Current Situation & Challenge:
I initially implemented an `onSubmit` client script. While it successfully displays a message ("Please attach attachment") if the checkbox is checked and no attachment is present, my client isn't satisfied with this functionality. They want the attachment field to become truly mandatory once the checkbox is checked.
Any insights, code snippets, or suggestions would be greatly appreciated!
Thanks in advance for your help!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 07:51 AM
you have only 2 options
1) continue using your client script to check mandatory attachment
OR
2) use attachment type variable and make it mandatory via UI policy based on checkbox checked
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
06-19-2025 06:57 AM
Hi @sravanku888
Have you tried the "attachment" type variable?
If the end users are going to attach a single file, then you can go with "attachment" type variable.
So that you can make the variable mandatory using ui policy.
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 06:59 AM
If client wants to use OOTB paper-clip icon then that's the only way to stop and validate
Another way is what @J Siva mentioned if they are going to attach only 1 file then you can use attachment type variable and make it mandatory via UI policy on that checkbox variable.
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
06-19-2025 07:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 07:02 AM
Yes