Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

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

Community Alums
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

I just tried this and it works:

vaSystem.attachToRecord(vaInputs.file_picker.getValue(), 'table_name', 'sys_id of created record');

Hello Akash,

The script which I am writing and mentioned by you is correct and working, but mistake done by me was, I have placed script utility in the end. Now I have kept after file picker like said by you and it worked.

Thanks You So much.

 

Thanks & Regards,

S.Swaroop.

Can this also be done for RITM in the same code, or do I need to make a separate topic?

js20
Mega Guru

Is there solution for this? I am trying to save attachment selected by File picker into Case.