Attachment downloadable variable not working

Prudhvi Raj4
Tera Guru

Hi Team,

We have record producer where I have created a "Rich Text label" type variable which is used to download a attachment when user clicks on it. For that I had first attached the file to variable where it created a record on sys_attachment table from there attachment table I copied the sys_id of attachment and given Rich Text label variable as 'link'. It working fine on DEV instance but when code moved to QA it's downloading a black file and file size says 0kb. I am exporting the xml file from sys_attachment table and moving it to QA instance, to keep all the instance code in sync I am doing export and import but it's not working please let me know the correct way do it.

PrudhviRaj4_0-1697788148808.png

PrudhviRaj4_1-1697788186178.png

Regards,

Prudhvi

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Prudhvi Raj4 

attachment metadata is stored in sys_attachment_doc.

So you need to move those as well.

Why not have a manual activity to add that file and then update the sysId dynamically in the next instance?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Prudhvi Raj4 

attachment metadata is stored in sys_attachment_doc.

So you need to move those as well.

Why not have a manual activity to add that file and then update the sysId dynamically in the next instance?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

Thanks for the response.

importing data to sys_attachment_doc table worked as expected. Can you please let me know in detail about what you mean by manual activity to add file means.

 

Thanks,

Prudhvi

@Prudhvi Raj4 

manual activity means add file to that record from an admin account

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@Prudhvi Raj4 

try this

1) attach the file to catalog item rather than variable

2) then pick the sysId and then check after migration if it works fine

If not then use the metadata approach

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader