We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to add Attachment to Existing Incident Record using Virtual Agent.

swaroop
Kilo Sage

Hello All,

 

In Virtual Agent I have created a topic, in which I should update an Incident with Attachment provided by end user in Chat Bot. I am using File Picker to Attach the file. I have tried using 'vaSystem.attacheRecord' and tried using script action and GlideRecord the 'sys_attachement' table. But it didn't worked. Can anyone suggest me how to update the Incident Record with provided Attachment in Virtual Agent.

 

 

Thanks & Regards,

S.Swaroop.

1 ACCEPTED SOLUTION

Not applicable

hi @swaroop ,

 

After the file picker use the script action as :

 

(function execute() {
vaSystem.attachToRecord(vaInputs.attachment, 'incident', vaInputs.select_incident);
})()
 
attachment - is file picker variable
select_incident - is variable for incident
 
Please mark if helpful and accept it as solution
 
Thanks
Akash

View solution in original post

8 REPLIES 8

Not applicable

hi @swaroop ,

 

After the file picker use the script action as :

 

(function execute() {
vaSystem.attachToRecord(vaInputs.attachment, 'incident', vaInputs.select_incident);
})()
 
attachment - is file picker variable
select_incident - is variable for incident
 
Please mark if helpful and accept it as solution
 
Thanks
Akash

Hello Akash,

I have tried giving Incident sys_id in the place of 'vaInputs.select_incident' and it's not working.

 

Thanks & Regards,

S.Swaroop.

Not applicable

hi @swaroop ,

You don't need to give Sys ID. 

just provide the variable which is used to select incident.

 
Please mark if helpful and accept it as solution
 
Thanks
Akash

 

Hey @Community Alums 

 

I am implementing this logic but it doesn't seem to work. I used your code but after uploading the image in virtual agent it is not attaching the image. I am getting an error saying : having technical issues can't move forward. " can you guide me a little where I might be wrong