How to add multiple attachments from Virtual Agent while creating the Incident?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2022 05:16 AM
How to add multiple attachments from Virtual Agent while creating the Incident.
- Labels:
-
Agent Chat
-
AI Search
-
Virtual Agent

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2022 06:14 AM
I just have this achieved via a simple loop:
- "Would you like to add one or more attachments?"
- If Yes, File Upload input then loop back to 1
- If No, continue flow
If you want to go crazy, you can variablize the wording of that question so it's different after the first upload, i.e. "Would you like to add an attachment?", then after that, "Would you like to add any more attachments?".
I kept it simple with that universal wording though 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2022 06:36 AM
Yes, it worked... Can you also help with the below query?
https://community.servicenow.com/community?id=community_question&sys_id=00e731cfdb5a4910904fa9fb13961924
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 02:32 AM
Whenever I do this the first attachment disappears, presumably overwritten?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 10:26 AM
It should not overwrite it. Every time you do a File Upload, it should be a new file (sys_attachment record).
See if this visualization helps - this is my Add Attachment topic block:
The canWrite logic is something unique to us - we needed to allow users to attach files to records that they don't normally have write access to, which prevents ootb vaSystem.attachToRecord()* - done from the "Attach file to record" script - from working. If the user doesn't have write access, I instead use GlideSysAttachment.copy() to copy the attachments from the current sys_cs_conversation_task to the specified record (in the topic block input).
*Also note that in Washington DC, you no longer need this line of code and you can use the ootb Update Record action to attach the file to a record with no code. This too adheres to ACLs and requires the user to have write access to the record.
Does that help?