# Deep Copy (intra-space)

**URL:** <https://community.fibery.io/t/deep-copy-intra-space/6144>\
**Category:** Ideas & Features\
**Created:** [May 2, 2024, 10:54pm UTC](https://community.fibery.io/t/deep-copy-intra-space/6144 "2024-05-02T22:54:55Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [May 3, 2024, 7:35pm UTC](https://community.fibery.io/t/deep-copy-intra-space/6144/6 "2024-05-03T19:35:32Z")

</div>

See @Polina_Zenevich’s post here, for how to handle all the field types while cloning:

> [@\[✔️ DONE\] Duplicate a record](https://community.fibery.io/t/done-duplicate-a-record/386/7):
>
> Then I can suggest you add a Duplicate a record button slight_smile Here is the code you can use const fibery = context.getService('fibery'); const schema = await fibery.getSchema(); await Promise.all(args.currentEntities.map(async (template) =\> { const type = template.type; const newEntityTemplate = schema.typeObjectsByName[type].fieldObjects .reduce((result, fieldObject) =\> { if (fieldObject.type === "fibery/Button" || fieldObject.type === "Collaboration~Docum…

---

_[View the full topic](https://community.fibery.io/t/deep-copy-intra-space/6144)._
