Remove attachment from catalog form based on a filed onchange
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2022 04:14 AM
Hi,
I have an attachment added to the form based on field on change value.
If the user chooses option A - attachment is mandatory --> I have completed this.
If the user chooses option B - attachment is not needed. if anything is already attached then we need to remove the attachment.
When i attach the doc in the form, the table is sc_cart_item. I am not able to figure what the table sys_id is referring to.
How do i idnetify the attachment and delete it?
gel('sysparm_item_guid') is not working.
Please let me know a solution for this requirement.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2022 04:28 AM
Hi Charanya,
You can use the attachment type variable instead of writing complex script. you only need to write onchange client script on attachment type variable.
check below YouTube video to get an idea about how to use attachment type variable.
Attachment Variable in ServiceNow
Regards,
Harshal.