# Is there a way to duplicate/assign files when creating an entity in an automation?

**URL:** <https://community.fibery.io/t/is-there-a-way-to-duplicate-assign-files-when-creating-an-entity-in-an-automation/4831>\
**Category:** Get Help\
**Tags:** files\
**Created:** [July 22, 2023, 11:44am UTC](https://community.fibery.io/t/is-there-a-way-to-duplicate-assign-files-when-creating-an-entity-in-an-automation/4831 "2023-07-22T11:44:17Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![njyo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/njyo/32/923_2.png) [@njyo](https://community.fibery.io/u/njyo)\
**Post date:** [August 3, 2023, 4:24am UTC](https://community.fibery.io/t/is-there-a-way-to-duplicate-assign-files-when-creating-an-entity-in-an-automation/4831/3 "2023-08-03T04:24:06Z")

</div>

Thanks a lot, @Matt_Blais, needed a few days to get back to this topic. 🫠

I’ve set this up as a CRON-style job (there is another action that connects the mail with the contact, if that exists already):

 ![2023-08-03 at 12.09](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/c/cade49191246c38b3fde1578781d35f458ad4a67.png)

The main remaining question for me to use this is, how do I pass the `targetEntityId` into the script? I think it should exist in `[Step 1 Email Message].[Contact].[Public Id]` but I’m not sure how to pass it into the script.  
(as [mentioned elsewhere](https://community.fibery.io/t/can-i-use-js-when-creating-a-slack-message/4655/8), the whole scripting interface is unclear to me as the documentation is confusing to me)

Thanks a lot,  
Wolf

---

_[View the full topic](https://community.fibery.io/t/is-there-a-way-to-duplicate-assign-files-when-creating-an-entity-in-an-automation/4831)._
