Flow Designer Copy Attachment not working

User282167
Kilo Contributor

Building a flow in flow designer, and the last steps are to

  1. create a knowledge article using the information contained in the problem_task record
  2. confirm Knowledge article exists
  3. copy the attachment from the problem_task record to this newly created knowledge article

find_real_file.png

Step 1 and 2 works and I can see the Knowledge article but step 3 does not work as expected.

find_real_file.png

 

find_real_file.png

find_real_file.png

Copy attachment step keeps on giving this error

Error: The Record type problem_task does not match with Attachment table type. (sys_script_include.5430bdf89313130079b5925cf67ffb04.script; line 30)

even though i can see all the correct values are being returned

find_real_file.png

Any guidance or help on what I am doing wrong will be appreciated.

 

1 ACCEPTED SOLUTION

Thanks for sharing the image.

I believe this question was answered previously.

if you think there is any response that helps you please mark that helpful or accepted so that this thread can be closed.

Regards
Ankur

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

View solution in original post

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

As per the docs you need to give the sys_attachment record as Source Attachment and not the Problem Task record

https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/administer/flow-designer/referen...

lookup the attachments on the trigger record, then use the "Look Up Record" action on the sys_attachments table to get the attachment record to pass into the "Copy Attachment" action

sharing 1 link for help

https://community.servicenow.com/community?id=community_question&sys_id=2a5c086adb9a4c105129a851ca96...

Mark āœ… Correct if this solves your issue and also mark šŸ‘ Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Hi Ankur

Thank you for your response. I added this step

find_real_file.png

And then I referenced this returned record in my Copy

find_real_file.png

It now copies the attachment as expected.

 

I now have a follow up question. How do I prevent it from adding a duplicate attachment to the target record.

 

Thank you.

Deon

Hi Deon,

Not that much sure on this part

If you want to prevent duplicate attachment from being added might be you need to create some custom action which checks before adding attachment is attachment is already added or not

Regards
Ankur

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

Thank you for coming back to me. I believe a Before insert Business Rule will also work as per this article.

find_real_file.png 

Kind Regards

Deon