How to duplicate file object?

Hi!

I the app we have a database connected file object Vedlegg. I would like to copy that object. I have tried to use ‘duplicate objects’ action node, with Vedlegg as source, and Vedlegg MANY (runtime only) as a destination, and then persisting Vedlegg MANY.
File was copied, but the file size is 0 and Original file name is undefined.

Screenshot 2024-01-30 at 14.59.22

Am i doing something wrong?

Thank you

Hi,

Thank you for your question!

The recommended way to duplicate a file object is to use the Create File Object action node. The source type can be changed to URL, and here you can use the File Content URL of the file you wish to duplicate. It will then look something like this:
image

Rhys

Thanks. Since i need to copy multiple attachments, i will then need to iterate through them and copy each one. That is not the most elegant solution, but it works. I would recommend to write somewhere in the documentation that it is not recommended to use ‘duplicate objects’ action node on the file object class (because it won’t work).