Can i make Add attachment mandatory based on variable question

shaik_irfan
Tera Guru

Hi,

I am working on a Record producer and i need to make it mandatory when i have a question as Mandatory Can we do that?

find_real_file.png

I tried using Variable type attachment but unfortunately it is not working as per use case and ended up having multiple issues like we cannot add mulitple attachments.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@shaik.irfan 

So you want to make attachment mandatory on record producer during submission based on some other variable value?

OR

there is an attachment type variable and you want to make it mandatory?

If it's the first case then check my blog on mandatory attachments; enhance it for your requirement

If my blog helps please mark it helpful

Verify Mandatory Attachments Count on Catalog Item

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

8 REPLIES 8

Allen Andreas
Administrator
Administrator

Hi,

You can create an onSubmit client script to review the current value of 'x' variable and if 'y', then make the attachment mandatory (at least 1 or more attachments to be required). Please see other threads like here: https://community.servicenow.com/community?id=community_article&sys_id=0f0c5290dbe7f380d82ffb2439961...

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

@Allen A 

 

I did gone through this solution earlier but it did not worked for us.

 

https://serviceportal.io/downloads/require-attachments/

 

Because we need to set the Mandatory attachments set to true in the portal setting and it is mandatory every time 😞

Hi,

If you set the attachments to mandatory true in the service portal settings, then yes, it'll be mandatory all the time.

Are you unable to change that to false and then let your script verify the true need for an attachment?

Also, as a side note, please always state things in your original post that you've tried, just to help us...help you. Otherwise, we don't know what you've tried, etc.?

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Thank you sir, I tried using a type called Variable but it is not working for me since it allows only one attachment.

 

When i import update set posted by Nathan which works only when i set the Mandatory attachments mandatory, i cannot make attachment mandatory based on the condition