How to make attachment non mandatory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2024 06:06 AM
Hi how to make attachment non mandatory based on variable choices can anyone help me out in this. Thanks in advance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2024 06:09 AM
Hi @Community Alums
You can follow this article to achieve the same:
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2024 06:09 AM
Hi @Community Alums
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2024 05:40 AM
Its not exactly fits to my requirement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2024 06:32 AM
@Community Alums
You can write catalog client script onchange
function onChange(control, oldValue, newValue, isLoading) {
var variableValue = g_form.getValue('ur_variable_name');
if (isLoading || variableValue === '') {
return;
}
var attachmentField = g_form.getControl('attachment_field');
if (variableValue === 'specific_choice') {
attachmentField.setAttribute('mandatory', 'false');
} else {
attachmentField.setAttribute('mandatory',
'true');
}
}
Note:- Please replace your variable name
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
Regards,
CB