Clone a record with a button : Part 1

Have you ever needed to copy, or rather, clone a record, perhaps from one entity to another or even within the same entity? I encountered this challenge and was initially clueless. However, after summarizing my knowledge and consulting Copilot, the internet, and YouTube, I discovered several articles on LinkedIn and a YouTube video. These resources were sufficient to spark my creativity.

I will split this large article in multiple sections and sites.

The Project

For my requirements, I would only need to utilize Action, JavaScript, and a Plugin. However, as a proficient developer, it’s important to plan for the future. It should be made more scalable and designed in such a way that it can be reused without modifying the code, especially the plugin.

To clone a record easily in the front end, I utilized several components: a Model-Driven App with one Entity, a JavaScript web resource, an Action, and a Plugin. Additionally, it’s worth noting that while PowerFx can be used in the command bar with PowerApps‘ new custom command bar feature, its functionality, unfortunately, seems to be limited.

Achieve it!

We aim to develop a Model-Driven App that allows users to configure a „pipeline“ style cloning process. Users should be able to easily select the source entity and the attributes they wish to copy or clone. They can also specify a target entity and target attributes. I have decided to allow one target entity per pipeline. Therefore, for different cloning „paths,“ users will need to specify one record for each target entity.

We specify the target attributes to ensure that the logical names match. It is not possible to clone a record if the attributes and their logical names do not align, especially in this version.