Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Map the Attachment in the Record Producer to the "Manage Attachments" paper clip on target record

Amy13
Tera Contributor

I have a record producer with an Attachment type variable. I want to show this attachment on the target incident form, but not in a custom attachment field (if I just clicked on Map, it would be pretty straight forward). I want it to transfer to the "Manage Attachments" paperclip on the form. Is this even possible? How do I do that?

 

find_real_file.png

1 REPLY 1

Bhaba
Tera Expert

Hi Amy,

You'll be able to do it using REST API to the custom file attachment fields.

- Create a file using Attachment API. This will create a record in Attachments (sys_attachment), or Attachment Documents (sys_attachment_doc).

- Upload an attachment 

- Set a custom table name

- Set a table sys_id to the record sys_id

- Under Request body, place the attachment data

Lastly, populate the attachment sys_id in the field of type attachment on the record. After updating the field with that sys_id, it should display on the target record.

Hope this works for you. Please reply back for any query.

 

Thanks.