Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

To add client condition in attachment action by using javascript:

pratikshabh
Tera Contributor

I want to fetch attachment sys ids in a filter where action model field is used which attachmentSysId.Screenshot 2025-08-19 225306.png

 

I have added condition like this but it is not showing attachment action on the form even if the attachments are getting added. I have tried the same code in attachment table by using sys is one of it is showing those sys_ids. Could you suggest something to add condition 

14 REPLIES 14

jcmings
Mega Sage

I am not familiar with that script include, but you do have a typo -- you are missing the t in checkAttachment1() after global.

Yes I corrected it.but the same behaviour

Can you explain what you are trying to accomplish? I'm not following your original explanation.

pratikshabh
Tera Contributor

 I have a checkbox on attachment table.When it is true I need to show that attachment action and if it is false ,I need to hidd it.So I thought if adding condition where it will check if attachmentsysid is one of sys ids which I am sending from script include in the format of an array